added uri type checking

This commit is contained in:
aj 2019-10-10 11:58:37 +01:00
parent 94b23b5c66
commit 25e6998a79

View File

@ -127,6 +127,10 @@ class PlaylistEngine:
if name: if name:
playlist = next((i for i in playlist_source.playlists if i.name == name), None) playlist = next((i for i in playlist_source.playlists if i.name == name), None)
else: else:
if uri.object_type is not Uri.ObjectType.playlist:
raise TypeError('uri not a playlist')
playlist = next((i for i in playlist_source.playlists if i.uri == uri), None) playlist = next((i for i in playlist_source.playlists if i.uri == uri), None)
if playlist is None: if playlist is None: