Ensure that music playlists are not synced if music is deactivated

This commit is contained in:
Croneter 2018-05-03 08:01:26 +02:00
parent df7bfd2e0c
commit c61fc3241f

View file

@ -100,6 +100,8 @@ def create_kodi_playlist(plex_id=None, updated_at=None):
playlist = PL.Playlist_Object() playlist = PL.Playlist_Object()
playlist.id = api.plex_id() playlist.id = api.plex_id()
playlist.type = v.KODI_PLAYLIST_TYPE_FROM_PLEX[api.playlist_type()] playlist.type = v.KODI_PLAYLIST_TYPE_FROM_PLEX[api.playlist_type()]
if not state.ENABLE_MUSIC and playlist.type == v.KODI_PLAYLIST_TYPE_AUDIO:
return
playlist.plex_name = api.title() playlist.plex_name = api.title()
playlist.plex_updatedat = updated_at playlist.plex_updatedat = updated_at
LOG.info('Creating new Kodi playlist from Plex playlist: %s', playlist) LOG.info('Creating new Kodi playlist from Plex playlist: %s', playlist)
@ -426,6 +428,9 @@ class PlaylistEventhandler(FileSystemEventHandler):
return return
if event.src_path.startswith(v.PLAYLIST_PATH_MIXED): if event.src_path.startswith(v.PLAYLIST_PATH_MIXED):
return return
if (not state.ENABLE_MUSIC and
event.src_path.startswith(v.PLAYLIST_PATH_MUSIC)):
return
_method_map = { _method_map = {
EVENT_TYPE_MODIFIED: self.on_modified, EVENT_TYPE_MODIFIED: self.on_modified,
EVENT_TYPE_MOVED: self.on_moved, EVENT_TYPE_MOVED: self.on_moved,