forked from platypush/platypush
[music.mopidy] Handle the case where add
returns a list.
This commit is contained in:
parent
1192782729
commit
d813356d9c
1 changed files with 2 additions and 0 deletions
|
@ -255,6 +255,8 @@ class MusicMopidyPlugin(RunnablePlugin):
|
||||||
ret = self._add(resource, position=0)
|
ret = self._add(resource, position=0)
|
||||||
if not ret:
|
if not ret:
|
||||||
self.logger.warning('Failed to add %s to the tracklist', resource)
|
self.logger.warning('Failed to add %s to the tracklist', resource)
|
||||||
|
elif isinstance(ret, list):
|
||||||
|
track_id = ret[0].get('tlid')
|
||||||
elif isinstance(ret, dict):
|
elif isinstance(ret, dict):
|
||||||
track_id = ret.get('tlid')
|
track_id = ret.get('tlid')
|
||||||
elif position is not None:
|
elif position is not None:
|
||||||
|
|
Loading…
Reference in a new issue