Ignore case when deciding whether to sync playlists

This commit is contained in:
Croneter 2018-07-04 07:46:30 +02:00
parent 1eed16dd52
commit 98ba2b8caa

View file

@ -94,8 +94,8 @@ def create_kodi_playlist(plex_id=None, updated_at=None):
raise PL.PlaylistError('Could not get Plex playlist %s' % plex_id) raise PL.PlaylistError('Could not get Plex playlist %s' % plex_id)
api = API(xml) api = API(xml)
if state.SYNC_SPECIFIC_PLEX_PLAYLISTS: if state.SYNC_SPECIFIC_PLEX_PLAYLISTS:
prefix = utils.settings('syncSpecificPlexPlaylistsPrefix') prefix = utils.settings('syncSpecificPlexPlaylistsPrefix').lower()
if api.title() and not api.title().startswith(prefix): if api.title() and not api.title().lower().startswith(prefix):
LOG.debug('User chose to not sync playlist %s', api.title()) LOG.debug('User chose to not sync playlist %s', api.title())
return return
playlist = PL.Playlist_Object() playlist = PL.Playlist_Object()
@ -451,8 +451,8 @@ def sync_kodi_playlist(path):
except PL.PlaylistError: except PL.PlaylistError:
pass pass
else: else:
prefix = utils.settings('syncSpecificKodiPlaylistsPrefix') prefix = utils.settings('syncSpecificKodiPlaylistsPrefix').lower()
if playlist.kodi_filename.startswith(prefix): if playlist.kodi_filename.lower().startswith(prefix):
return True return True
return False return False