diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 6b46d60c..7ab8955d 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -110,7 +110,7 @@ msgstr "" # PKC settings sync options msgctxt "#30020" -msgid "Sync Plex playlists" +msgid "Sync Plex playlists (reboot Kodi!)" msgstr "" # PKC settings sync options diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 15c0331d..08e8b0ba 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -51,7 +51,6 @@ STATE_SETTINGS = { 'forceReloadSkinOnPlaybackStop': 'FORCE_RELOAD_SKIN', 'fetch_pms_item_number': 'FETCH_PMS_ITEM_NUMBER', 'imageSyncNotifications': 'IMAGE_SYNC_NOTIFICATIONS', - 'enablePlaylistSync': 'SYNC_PLAYLISTS', 'syncSpecificPlexPlaylists': 'SYNC_SPECIFIC_PLEX_PLAYLISTS', 'syncSpecificKodiPlaylists': 'SYNC_SPECIFIC_KODI_PLAYLISTS' } diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index cc23ade0..f264c8ec 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -20,10 +20,16 @@ from . import plex_functions as PF from .plex_api import API from .library_sync import get_metadata, process_metadata, fanart, sync_info from . import music -from . import playlists from . import variables as v from . import state +if utils.settings('enablePlaylistSync') == 'true': + # Xbox cannot use watchdog, a dependency for PKC playlist features + from . import playlists + PLAYLIST_SYNC_ENABLED = True +else: + PLAYLIST_SYNC_ENABLED = False + ############################################################################### LOG = getLogger('PLEX.librarysync') @@ -265,7 +271,7 @@ class LibrarySync(Thread): repair) if not self._full_sync(): return False - if not playlists.full_sync(): + if PLAYLIST_SYNC_ENABLED and not playlists.full_sync(): return False return True @@ -1186,7 +1192,7 @@ class LibrarySync(Thread): continue status = int(item['state']) if typus == 'playlist': - if not state.SYNC_PLAYLISTS: + if not PLAYLIST_SYNC_ENABLED: continue playlists.websocket(plex_id=unicode(item['itemID']), status=status) @@ -1560,7 +1566,8 @@ class LibrarySync(Thread): initial_sync_done = True kodi_db_version_checked = True last_sync = utils.unix_timestamp() - playlist_monitor = playlists.kodi_playlist_monitor() + if PLAYLIST_SYNC_ENABLED: + playlist_monitor = playlists.kodi_playlist_monitor() self.sync_fanart() self.fanartthread.start() else: @@ -1612,7 +1619,8 @@ class LibrarySync(Thread): initial_sync_done = True last_sync = utils.unix_timestamp() LOG.info('Done initial sync on Kodi startup') - playlist_monitor = playlists.kodi_playlist_monitor() + if PLAYLIST_SYNC_ENABLED: + playlist_monitor = playlists.kodi_playlist_monitor() artwork.Artwork().cache_major_artwork() self.sync_fanart() self.fanartthread.start() diff --git a/resources/lib/playlists/__init__.py b/resources/lib/playlists/__init__.py index a6c3fcf2..95442040 100644 --- a/resources/lib/playlists/__init__.py +++ b/resources/lib/playlists/__init__.py @@ -113,9 +113,6 @@ def full_sync(): Full sync of playlists between Kodi and Plex. Returns True is successful, False otherwise """ - if not state.SYNC_PLAYLISTS: - LOG.debug('Not syncing playlists') - return True LOG.info('Starting playlist full sync') with state.LOCK_PLAYLISTS: return _full_sync() @@ -282,9 +279,6 @@ class PlaylistEventhandler(events.FileSystemEventHandler): :type event: :class:`FileSystemEvent` """ - if not state.SYNC_PLAYLISTS: - # Sync is deactivated - return path = event.dest_path if event.event_type == events.EVENT_TYPE_MOVED \ else event.src_path if not sync_kodi_playlist(path): diff --git a/resources/lib/state.py b/resources/lib/state.py index ac25354c..ced1b486 100644 --- a/resources/lib/state.py +++ b/resources/lib/state.py @@ -57,8 +57,6 @@ 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 # Only sync specific Plex playlists to Kodi? SYNC_SPECIFIC_PLEX_PLAYLISTS = False # Only sync specific Kodi playlists to Plex?