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 @@ <string id="30235">Extras</string> <string id="30236">Sync Theme Music</string> <string id="30237">Sync Extra Fanart</string> + <string id="30238">Sync Movie BoxSets</string> <!-- Default views --> <string id="30300">Active</string> 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 @@ <category label="Automatic sync"> <!-- Auto sync optionss --> <setting id="enablePlayCountSync" type="bool" label="Enable watched/resume status sync" default="true" visible="true" enable="true" /> <setting id="syncSettingStartup" type="labelenum" label="Startup Sync:" values="Full Sync|Incremental Sync|None" default="Full Sync" /> - <setting id="syncSettingBackground" type="labelenum" label="Scheduled Sync:" values="Full Sync|Incremental Sync|None" default="Full Sync" visible="true" enable="true" /> + <setting id="syncSettingBackground" type="labelenum" label="Scheduled Sync:" values="Full Sync|Incremental Sync|None" default="Incremental Sync" visible="true" enable="true" /> <setting id="dbSyncIndication" type="labelenum" label="DB Sync Indication:" values="None|Notify OnChange|Notify OnFinish|BG Progress|Dialog Progress" default="None" /> <setting id="playCountSyncIndication" type="labelenum" label="Play Count Sync Indication:" values="None|Notify OnChange|Notify OnFinish|BG Progress|Dialog Progress" default="None" /> </category> @@ -28,6 +28,7 @@ <category label="30235"> <!-- Extra Sync options --> <setting id="syncThemeMusic" type="bool" label="30236" default="false" visible="true" enable="true" /> <setting id="syncExtraFanart" type="bool" label="30237" default="false" visible="true" enable="true" /> + <setting id="syncMovieBoxSets" type="bool" label="30238" default="false" visible="true" enable="true" /> </category> <category label="30022"> <!-- Advanced -->