Ensure that music playlists are not synced if music is deactivated
This commit is contained in:
parent
df7bfd2e0c
commit
c61fc3241f
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue