Hi all,
I would like to play Spotify and simple MP3 folders with Mopidy and build an external script to interface with Mopidy. Now I want to create an extension out of it and start to internalize mpc
calls.
For Spotify it’s working fine, for testing I changed from
mpc clear && mpc add "spotify:album:1xpGyKyV26uPstk1Elgp9Q" && mpc play
to
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.clear"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add", "params": { "uris": [ "spotify:album:1xpGyKyV26uPstk1Elgp9Q" ] } }' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.play"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
For MP3s, so far I could play back my MP3 folder with mpc
and the files were alphabetically sorted
mpc clear && mpc add "Files/folder1" && mpc play
With JSON-RPC this did not succeed for a folder, also not with an individual file.
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.clear"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add", "params": { "uris": [ "Files/folder1" ] } }' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add", "params": { "uris": [ "Files/folder1/file1.mp3" ] } }' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.play"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
How can I play a folder with MP3s via JSON-RPC API?
While at at, I got two more quick questions:
- Is there a way to find out what Spotify playlist is playing? I only found album info.
- Is there a Mopidy SQLite database I can extend with my own table?
Thanks
bluepuma