mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Merge branch 'master' of https://github.com/marcelveldt/plugin.video.mb3sync
Conflicts: resources/lib/LibrarySync.py
This commit is contained in:
commit
b3a178ab62
1 changed files with 58 additions and 2 deletions
|
@ -85,7 +85,46 @@ class LibrarySync():
|
||||||
|
|
||||||
for view in views:
|
for view in views:
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
updateNeeded = False
|
updateNeeded = False
|
||||||
|
=======
|
||||||
|
if(pDialog != None):
|
||||||
|
pDialog.update(0, "Sync DB : Processing " + view.get('title'))
|
||||||
|
total = len(movieData) + 1
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
for item in movieData:
|
||||||
|
xbmc.sleep(sleepVal)
|
||||||
|
if not item.get('IsFolder'):
|
||||||
|
kodiItem = ReadKodiDB().getKodiMovie(item["Id"])
|
||||||
|
allMovies.append(item["Id"])
|
||||||
|
progMessage = "Processing"
|
||||||
|
item['Tag'] = []
|
||||||
|
item['Tag'].append(view.get('title'))
|
||||||
|
if kodiItem == None:
|
||||||
|
WriteKodiDB().addMovieToKodiLibrary(item)
|
||||||
|
updateNeeded = True
|
||||||
|
progMessage = "Adding"
|
||||||
|
else:
|
||||||
|
WriteKodiDB().updateMovieToKodiLibrary(item, kodiItem)
|
||||||
|
progMessage = "Updating"
|
||||||
|
|
||||||
|
if(self.ShouldStop()):
|
||||||
|
return True
|
||||||
|
|
||||||
|
# update progress bar
|
||||||
|
if(pDialog != None):
|
||||||
|
percentage = int(((float(count) / float(total)) * 100))
|
||||||
|
if count % 10 == 0:
|
||||||
|
pDialog.update(percentage, message=progMessage + " Movie: " + str(count))
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
#process full tv shows sync
|
||||||
|
if processTvShows:
|
||||||
|
allTVShows = list()
|
||||||
|
allEpisodes = list()
|
||||||
|
tvShowData = ReadEmbyDB().getTVShows(True)
|
||||||
|
>>>>>>> 5127a770b59a941a51bae652ab239fafa77591b3
|
||||||
|
|
||||||
#process new movies
|
#process new movies
|
||||||
allMB3Movies = ReadEmbyDB().getMovies(view.get('id'), True, fullsync)
|
allMB3Movies = ReadEmbyDB().getMovies(view.get('id'), True, fullsync)
|
||||||
|
@ -125,8 +164,15 @@ class LibrarySync():
|
||||||
# update progress bar
|
# update progress bar
|
||||||
if(pDialog != None):
|
if(pDialog != None):
|
||||||
percentage = int(((float(count) / float(total)) * 100))
|
percentage = int(((float(count) / float(total)) * 100))
|
||||||
|
<<<<<<< HEAD
|
||||||
pDialog.update(percentage, message=progMessage + " Movie: " + str(count))
|
pDialog.update(percentage, message=progMessage + " Movie: " + str(count))
|
||||||
count += 1
|
count += 1
|
||||||
|
=======
|
||||||
|
if count % 10 == 0:
|
||||||
|
pDialog.update(percentage, message=progMessage + " Tv Show: " + str(count))
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
>>>>>>> 5127a770b59a941a51bae652ab239fafa77591b3
|
||||||
|
|
||||||
#initiate library update and wait for finish before processing any updates
|
#initiate library update and wait for finish before processing any updates
|
||||||
if updateNeeded:
|
if updateNeeded:
|
||||||
|
@ -160,8 +206,16 @@ class LibrarySync():
|
||||||
# update progress bar
|
# update progress bar
|
||||||
if(pDialog != None):
|
if(pDialog != None):
|
||||||
percentage = int(((float(count) / float(total)) * 100))
|
percentage = int(((float(count) / float(total)) * 100))
|
||||||
|
<<<<<<< HEAD
|
||||||
pDialog.update(percentage, message=progMessage + " Movie: " + str(count))
|
pDialog.update(percentage, message=progMessage + " Movie: " + str(count))
|
||||||
count += 1
|
count += 1
|
||||||
|
=======
|
||||||
|
if count % 10 == 0:
|
||||||
|
pDialog.update(percentage, message=progMessage + " Episode: " + str(count))
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
|
||||||
|
>>>>>>> 5127a770b59a941a51bae652ab239fafa77591b3
|
||||||
|
|
||||||
if(pDialog != None):
|
if(pDialog != None):
|
||||||
pDialog.update(0, message="Removing Deleted Items")
|
pDialog.update(0, message="Removing Deleted Items")
|
||||||
|
@ -263,7 +317,8 @@ class LibrarySync():
|
||||||
# update progress bar
|
# update progress bar
|
||||||
if(pDialog != None):
|
if(pDialog != None):
|
||||||
percentage = int(((float(count) / float(totalCount)) * 100))
|
percentage = int(((float(count) / float(totalCount)) * 100))
|
||||||
pDialog.update(percentage, message="Updating Movie: " + str(count))
|
if count % 10 == 0:
|
||||||
|
pDialog.update(percentage, message="Updating Movie: " + str(count))
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
#process Tv shows
|
#process Tv shows
|
||||||
|
@ -306,7 +361,8 @@ class LibrarySync():
|
||||||
# update progress bar
|
# update progress bar
|
||||||
if(pDialog != None):
|
if(pDialog != None):
|
||||||
percentage = int(((float(count) / float(totalCount)) * 100))
|
percentage = int(((float(count) / float(totalCount)) * 100))
|
||||||
pDialog.update(percentage, message="Updating Episode: " + str(count))
|
if count % 10 == 0:
|
||||||
|
pDialog.update(percentage, message="Updating Episode: " + str(count))
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in a new issue