Hey, I’m writing a serial port frontend for mopidy to work with my Arduino [1]. I intend to switch “channels” with a rotating knob, like on old radios. Such a channel would be an URI defined in the config file.
Anyways, I was under the impression that this code
self.core.tracklist.add(uri='soundcloud:directory:explore/10')
should correctly fetch n
tracks from this soundcloud explore stream and add it to my tracklist. But what actually happens is I get an error that no such track was found, because lookup
in mopidy-soundcloud is implemented in a way to look for specific tracks and doesn’t resolve streams (is this fully intended behavior?).
I worked around it with
tracks = flatten(map(lambda ref: self.core.library.lookup(ref.uri).get(), self.core.library.browse(channel_uri).get()))
self.core.tracklist.add(tracks=tracks, at_position=0).get()
I’m sure there is a better option? Should the lookup
function be extended?
Thank you very much,
Nikolaus