[music.mopidy] Handle the case where add returns a list.

This commit is contained in:
Fabio Manganiello 2024-04-24 01:13:03 +02:00
parent 1192782729
commit d813356d9c

View file

@ -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: