add some progress message to the Update BoxSets action
This commit is contained in:
parent
dd03c993b5
commit
4931fd4299
1 changed files with 16 additions and 0 deletions
|
@ -188,17 +188,33 @@ class LibrarySync():
|
||||||
|
|
||||||
# process box sets - TODO cope with movies removed from a set
|
# process box sets - TODO cope with movies removed from a set
|
||||||
if fullsync and addon.getSetting("syncMovieBoxSets") == "true":
|
if fullsync and addon.getSetting("syncMovieBoxSets") == "true":
|
||||||
|
|
||||||
|
if(pDialog != None):
|
||||||
|
progressTitle = "Sync DB : BoxSets"
|
||||||
|
pDialog.update(percentage, progressTitle, "Updating Movie: " + str(count))
|
||||||
|
|
||||||
utils.logMsg("Sync Movies", "BoxSet Sync Started", 1)
|
utils.logMsg("Sync Movies", "BoxSet Sync Started", 1)
|
||||||
boxsets = ReadEmbyDB().getBoxSets()
|
boxsets = ReadEmbyDB().getBoxSets()
|
||||||
|
|
||||||
|
if(pDialog != None):
|
||||||
|
total = len(boxsets) + 1
|
||||||
|
count = 1
|
||||||
|
|
||||||
for boxset in boxsets:
|
for boxset in boxsets:
|
||||||
|
if(pDialog != None):
|
||||||
|
percentage = int(((float(count) / float(total)) * 100))
|
||||||
|
pDialog.update(percentage, progressTitle, "Updating BoxSet: " + str(count) + " of " + str(total))
|
||||||
|
count += 1
|
||||||
if(self.ShouldStop(pDialog)):
|
if(self.ShouldStop(pDialog)):
|
||||||
return False
|
return False
|
||||||
boxsetMovies = ReadEmbyDB().getMoviesInBoxSet(boxset["Id"])
|
boxsetMovies = ReadEmbyDB().getMoviesInBoxSet(boxset["Id"])
|
||||||
WriteKodiDB().addBoxsetToKodiLibrary(boxset)
|
WriteKodiDB().addBoxsetToKodiLibrary(boxset)
|
||||||
|
|
||||||
for boxsetMovie in boxsetMovies:
|
for boxsetMovie in boxsetMovies:
|
||||||
if(self.ShouldStop(pDialog)):
|
if(self.ShouldStop(pDialog)):
|
||||||
return False
|
return False
|
||||||
WriteKodiDB().updateBoxsetToKodiLibrary(boxsetMovie,boxset)
|
WriteKodiDB().updateBoxsetToKodiLibrary(boxsetMovie,boxset)
|
||||||
|
|
||||||
utils.logMsg("Sync Movies", "BoxSet Sync Finished", 1)
|
utils.logMsg("Sync Movies", "BoxSet Sync Finished", 1)
|
||||||
|
|
||||||
if(pDialog != None):
|
if(pDialog != None):
|
||||||
|
|
Loading…
Reference in a new issue