diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index e62c76dc..a7dd588f 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -61,6 +61,11 @@ msgctxt "#30009" msgid "Enable image caching during Kodi playback (restart Kodi!)" msgstr "" +# PKC settings sync options +msgctxt "#30010" +msgid "Sync Plex playlists" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 53cfa51c..7b83fae6 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -51,7 +51,8 @@ STATE_SETTINGS = { 'enableMusic': 'ENABLE_MUSIC', 'forceReloadSkinOnPlaybackStop': 'FORCE_RELOAD_SKIN', 'fetch_pms_item_number': 'FETCH_PMS_ITEM_NUMBER', - 'imageSyncNotifications': 'IMAGE_SYNC_NOTIFICATIONS' + 'imageSyncNotifications': 'IMAGE_SYNC_NOTIFICATIONS', + 'enablePlaylistSync': 'SYNC_PLAYLISTS' } ############################################################################### diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 6f9258ce..44445898 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -1201,6 +1201,8 @@ class LibrarySync(Thread): continue status = int(item['state']) if typus == 'playlist': + if not state.SYNC_PLAYLISTS: + continue playlists.process_websocket(plex_id=str(item['itemID']), updated_at=str(item['updatedAt']), state=status) @@ -1558,7 +1560,7 @@ class LibrarySync(Thread): kodi_db_version_checked = True last_sync = utils.unix_timestamp() self.fanartthread.start() - if playlists.full_sync(): + if state.SYNC_PLAYLISTS and playlists.full_sync(): playlist_monitor = playlists.kodi_playlist_monitor() else: LOG.error('Initial start-up full sync unsuccessful') @@ -1605,7 +1607,7 @@ class LibrarySync(Thread): LOG.info('Done initial sync on Kodi startup') artwork.Artwork().cache_major_artwork() self.fanartthread.start() - if playlists.full_sync(): + if state.SYNC_PLAYLISTS and playlists.full_sync(): playlist_monitor = playlists.kodi_playlist_monitor() else: LOG.info('Startup sync has not yet been successful') diff --git a/resources/lib/state.py b/resources/lib/state.py index 60b15ede..67e4bbea 100644 --- a/resources/lib/state.py +++ b/resources/lib/state.py @@ -41,6 +41,8 @@ FORCE_RELOAD_SKIN = True SYNC_DIALOG = True # Shall Kodi show dialogs for syncing/caching images? (e.g. images left to sync) IMAGE_SYNC_NOTIFICATIONS = True +# Sync playlists from Plex to Kodi and vice-versa? +SYNC_PLAYLISTS = True # Is synching of Plex music enabled? ENABLE_MUSIC = True # How often shall we sync? diff --git a/resources/settings.xml b/resources/settings.xml index d8e46400..cccbbb15 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -58,6 +58,7 @@ +