added percentage to progress dialog on sync

This commit is contained in:
Marcel van der Veldt 2015-05-08 12:05:15 +02:00
parent e592df0a36
commit 77c8f6862e

View file

@ -156,7 +156,8 @@ class LibrarySync():
if(pDialog != None): if(pDialog != None):
progressTitle = "Processing " + view.get('title') + " (" + str(count) + " of " + str(total) + ")" progressTitle = "Processing " + view.get('title') + " (" + str(count) + " of " + str(total) + ")"
pDialog.update(0, "Emby for Kodi - Running Sync", progressTitle) percentage = int(((float(count) / float(total)) * 100))
pDialog.update(percentage, "Emby for Kodi - Running Sync", progressTitle)
count += 1 count += 1
kodiMovie = None kodiMovie = None
@ -181,7 +182,8 @@ class LibrarySync():
count = 1 count = 1
for boxset in boxsets: for boxset in boxsets:
progressTitle = "Processing BoxSets"+ " (" + str(count) + " of " + str(total) + ")" progressTitle = "Processing BoxSets"+ " (" + str(count) + " of " + str(total) + ")"
pDialog.update(0, "Emby for Kodi - Running Sync", progressTitle) percentage = int(((float(count) / float(total)) * 100))
pDialog.update(percentage, "Emby for Kodi - Running Sync", progressTitle)
count += 1 count += 1
if(self.ShouldStop()): if(self.ShouldStop()):
return False return False
@ -230,7 +232,8 @@ class LibrarySync():
if(pDialog != None): if(pDialog != None):
progressTitle = "Processing MusicVideos (" + str(count) + " of " + str(total) + ")" progressTitle = "Processing MusicVideos (" + str(count) + " of " + str(total) + ")"
pDialog.update(0, "Emby for Kodi - Running Sync", progressTitle) percentage = int(((float(count) / float(total)) * 100))
pDialog.update(percentage, "Emby for Kodi - Running Sync", progressTitle)
count += 1 count += 1
kodiVideo = None kodiVideo = None
@ -280,7 +283,8 @@ class LibrarySync():
if(pDialog != None): if(pDialog != None):
progressTitle = "Processing " + view.get('title') + " (" + str(count) + " of " + str(total) + ")" progressTitle = "Processing " + view.get('title') + " (" + str(count) + " of " + str(total) + ")"
pDialog.update(0, "Emby for Kodi - Running Sync", progressTitle) percentage = int(((float(count) / float(total)) * 100))
pDialog.update(percentage, "Emby for Kodi - Running Sync", progressTitle)
count += 1 count += 1
if item.get('IsFolder') and item.get('RecursiveItemCount') != 0: if item.get('IsFolder') and item.get('RecursiveItemCount') != 0:
@ -392,7 +396,8 @@ class LibrarySync():
if(pDialog != None): if(pDialog != None):
progressTitle = "Processing Music Songs (" + str(count) + " of " + str(total) + ")" progressTitle = "Processing Music Songs (" + str(count) + " of " + str(total) + ")"
pDialog.update(0, "Emby for Kodi - Running Sync", progressTitle) percentage = int(((float(count) / float(total)) * 100))
pDialog.update(percentage, "Emby for Kodi - Running Sync", progressTitle)
count += 1 count += 1
kodiSong = None kodiSong = None
@ -437,7 +442,8 @@ class LibrarySync():
if(pDialog != None): if(pDialog != None):
progressTitle = "Processing Music Artists (" + str(count) + " of " + str(total) + ")" progressTitle = "Processing Music Artists (" + str(count) + " of " + str(total) + ")"
pDialog.update(0, "Emby for Kodi - Running Sync", progressTitle) percentage = int(((float(count) / float(total)) * 100))
pDialog.update(percentage, "Emby for Kodi - Running Sync", progressTitle)
count += 1 count += 1
kodiArtist = None kodiArtist = None
@ -482,7 +488,8 @@ class LibrarySync():
if(pDialog != None): if(pDialog != None):
progressTitle = "Processing Music Albums (" + str(count) + " of " + str(total) + ")" progressTitle = "Processing Music Albums (" + str(count) + " of " + str(total) + ")"
pDialog.update(0, "Emby for Kodi - Running Sync", progressTitle) percentage = int(((float(count) / float(total)) * 100))
pDialog.update(percentage, "Emby for Kodi - Running Sync", progressTitle)
count += 1 count += 1
kodiAlbum = None kodiAlbum = None
@ -546,7 +553,6 @@ class LibrarySync():
for boxsetMovie in boxsetMovies: for boxsetMovie in boxsetMovies:
WriteKodiVideoDB().updateBoxsetToKodiLibrary(boxsetMovie,boxset, connection, cursor) WriteKodiVideoDB().updateBoxsetToKodiLibrary(boxsetMovie,boxset, connection, cursor)
#### PROCESS TV SHOWS #### #### PROCESS TV SHOWS ####
views = ReadEmbyDB().getCollections("tvshows") views = ReadEmbyDB().getCollections("tvshows")
for view in views: for view in views: