added uri type checking
This commit is contained in:
parent
94b23b5c66
commit
25e6998a79
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user