Backend Playlist handeling

Hi all,
after this thread i started to expand the existing soundcloud backend to Support Playlists. I added a Playlist Provider with the as_list Definition.

This is working quiet well. At the Moment my Playlists from soundcloud backend showing up at mopidy

/home/mopidy/mopidy-soundcloud# mpc lsplaylists
MyTest123
test_soundcloud
soundcloud

LOG mopidy:
INFO     Get playlists from soundcloud

But i am not able to load the Playlist in mopidy.

# mpc add test_soundcloud
error adding test_soundcloud: directory or file not found
LOG mopidy:
DEBUG    2017-01-01 11:14:54,927 [26109:MpdSession-11] mopidy.mpd.session
  Response to [::ffff:127.0.0.1]:37644: ACK [50@0] {add} directory or file not found

the playlistprovider function “lookup” is not called if the Playlist is loaded.
can someone tell me what function is required to handle that request?
What functions Needs to be modified/added.

i were not able to find the informations in backend api

please assist here with a hint. i am helpless :frowning:

Have you tried mpc load test_soundcloud?

thanks for your Support!
.
but the same result

INFO 2017-01-01 15:01:23,396 [7385:MpdSession-44] mopidy.mpd.session
New MPD connection from [::ffff:127.0.0.1]:43150
DEBUG 2017-01-01 15:01:23,398 [7385:MpdSession-44] mopidy.mpd.session
Request from [::ffff:127.0.0.1]:43150: command_list_begin
DEBUG 2017-01-01 15:01:23,399 [7385:MpdSession-44] mopidy.mpd.session
Request from [::ffff:127.0.0.1]:43150: load “test_soundcloud”
DEBUG 2017-01-01 15:01:23,400 [7385:MpdSession-44] mopidy.mpd.session
Request from [::ffff:127.0.0.1]:43150: command_list_end
DEBUG 2017-01-01 15:01:23,402 [7385:MpdSession-44] mopidy.mpd.session
Response to [::ffff:127.0.0.1]:43150: ACK [50@0] {load} No such playlist
DEBUG 2017-01-01 15:01:23,405 [7385:MpdSession-44] mopidy.internal.network
Client most likely disconnected.

where the mopidy core is checking for Playlists/ what backend functions are executed?

in the soundcloud playlistprovider i added debug Output for the “lookup” and “get_items” but they are not called/executed in any way :frowning:

It is mpc load test_soundcloud as @tkem says. You need to pass a URI if using add, for example, mpc add soundcloud:some_user:playlists:test_soundcloud (or however the Soundcloud URIs work). The mpc manual could definitely be clearer.

If your lookup function isn’t being executed then perhaps Mopidy doesn’t know how to route the playlist’s URI to the Soundcloud backend? I suggest you read Mopidy’s source if you have specific questions, just trace what the MPD frontend’s load command does. Or look at what other backends do.

it took some time, but i found it :slight_smile:

It is not working if the uri for a Playlist is "soundcloud:ID"
i have to use something like “soundcloud:folder:ID”. in this way my backend lookup function in the Playlist Provider is used to get the Playlist :relaxed:

ty for you Support!

note: why should i use the “Folder” structure? is it “important” or is it possible to use somehting generic like: soundcloud:playlist:ID
the soundcloud api Returns a unique id for each playlist

There is noting special about using “Folder”, you should be able to do use “playlist” or whatever you want, just as the other backends do. It just needs to be a Unique Resource Identifier that your particular backend can understand.