diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index d6b8a02e..2360909f 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -236,6 +236,7 @@ Extras Sync Theme Music Sync Extra Fanart + Sync Movie BoxSets Active diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index d2411c7f..4887c13b 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -165,15 +165,7 @@ class LibrarySync(): pDialog.update(0, progressTitle, "") total = len(allMB3Movies) + 1 count = 1 - - # process box sets - TODO cope with movies removed from a set - boxsets = ReadEmbyDB().getBoxSets() - for boxset in boxsets: - boxsetMovies = ReadEmbyDB().getMoviesInBoxSet(boxset["Id"]) - WriteKodiDB().addBoxsetToKodiLibrary(boxset) - for boxsetMovie in boxsetMovies: - WriteKodiDB().updateBoxsetToKodiLibrary(boxsetMovie,boxset) - + #process updates allKodiMovies = ReadKodiDB().getKodiMovies(True) for item in allMB3Movies: @@ -200,6 +192,21 @@ class LibrarySync(): viewCurrent += 1 + # process box sets - TODO cope with movies removed from a set + if fullsync and addon.getSetting("syncMovieBoxSets") == "true": + utils.logMsg("Sync Movies", "BoxSet Sync Started", 1) + boxsets = ReadEmbyDB().getBoxSets() + for boxset in boxsets: + if(self.ShouldStop(pDialog)): + return True + boxsetMovies = ReadEmbyDB().getMoviesInBoxSet(boxset["Id"]) + WriteKodiDB().addBoxsetToKodiLibrary(boxset) + for boxsetMovie in boxsetMovies: + if(self.ShouldStop(pDialog)): + return True + WriteKodiDB().updateBoxsetToKodiLibrary(boxsetMovie,boxset) + utils.logMsg("Sync Movies", "BoxSet Sync Finished", 1) + if(pDialog != None): progressTitle = "Removing Deleted Items" pDialog.update(0, progressTitle, "") diff --git a/resources/settings.xml b/resources/settings.xml index 805b0cce..42c3959c 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -10,7 +10,7 @@ - + @@ -28,6 +28,7 @@ +