Hi all,
as mentioned before, I want to resume previous played albums. I used mpc play n
before to start playing the nth track, then seek sec
.
I looked at PlaybackController.play(tlid=None), but that doesn’t take an index. It seems the tlid
is increased per track added over time. My next idea was to just do multiple PlaybackController.next()
. The docs state
If it was paused, it will still be paused
but for me that is not the case. If I do multiple next()
on my Raspi Zero mopidy
will suddenly start playing. With one sometimes two quick next()
it changes state to playing
without playing, with more it does start playing music.
Is there an easy solution to advance to the nth track in the tracklist?
Note: I created a shell script to reproduce the strange next()
behaviour:
echo clear
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.clear"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
echo
echo add
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
echo
sleep 3
echo play
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.play"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
echo
sleep 3
echo pause
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.pause"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
echo
sleep 3
echo state
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.get_state"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
echo
echo nexts
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.next"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.next"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.next"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.next"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.next"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
echo
sleep 3
echo state
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.get_state"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
echo
echo time
curl -d '{"jsonrpc": "2.0", "id": 1, "method": "core.playback.get_time_position"}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc
echo