Auto-playing multiple playlists with Tasker

Issue description:

I’m trying to automate a specific behavior and I’ve gotten it mostly figured out but there’s one remaining issue. I don’t know if it’s something I can fix with setting changes or if I would need to make a feature request.

First I’ll explain what I’m trying to achieve, just in case there’s a different/better/easier way to do it that I missed. I have two bluetooth devices, one at work and one in my car. I want music to play automatically whenever either device is connected, resuming from where it last left off, and stop playing when BT is disconnected. I used to do this with Musicolet but it only supports one playback queue, and now I want to use two separate playlists, one for work and one for the car.

I have three playlists. One is a regular playlist containing all the “work” tracks. The second is a Smart Album Playlist including only tracks that are on the Work playlist. I’m using this Smart Playlist instead of the regular Work playlist because it allows me to randomize albums instead of individual tracks. The third is a Smart Album Playlist including all locally cached albums.

To automate this using Tasker, I created a profile that runs when BT connects to the work device, it uses Send Indent with the action MEDIA_START, MEDIA_TYPE:playlist, ID:6L. Playlist 6 is the “Random Work Album” smart playlist. When BT is disconnected it runs MEDIA_COMMAND, COMMAND:stop. There’s a second profile that does the same actions but for the car device and playlist id.

Now the problem: When the MEDIA_START action runs, Symfonium does start playing with a new random album in that playlist, but I want to make it resume where it left off on that playlist. I tried including the RESUME:true option, but that seems to only resume position within a track, not the last position in the playlist. Anybody have any ideas how to do this?

Logs:

Upload description: Quaraxkad, uploaded through app

Additional information:

 

 

Reproduction steps:

 

 

Media provider:

Any provider

Screenshots:

     

You can’t resume fully random smart playlists due to how they work internaly.

You should use the stable random sort to have random that are stable between time.

I couldn’t find much information on how stable random worked. I switched the playlists to that and it’s working now, thanks!

Is there any way to have a stable random playlist automatically randomize itself after playing the last track, so that it will then resume from the start in a new order?

This is not possible no, as could cause issues with repeat mode and some other cases.

You can open a feature request to add a call in the API but as it’s very very specific need I’m not sure it’s worth it.

I’m not sure if an API call would help in this scenario, as the external app has no way of knowing when it should re-sort the list.

I don’t think it’s that specific a feature though. My reasoning being that Random lists are meant to be “Random”. If a playlist is sorted randomly and then repeated in that same order every time, it’s not really random anymore, is it? I think it makes sense logically to auto-sort itself after playing the final track. Then you essentially have a way to play a random album without repeats until they have all been played.

A truly random playback order could result in frequent repeats, and theoretically may never play a particular album. Presumably that’s what the existing random playlists are designed to solve, but they introduce the drawback of being static. Resorting after completion is a pretty simple way to have the best of both worlds, where everything gets played, nothing gets repeated.

EDIT: Can you clarify how RESUME:true works in the API call? Is it supposed to resume saved track positions, playlist position, etc?

Resume, resume what you ask it to resume.

And normal users use the multiple media queue, they do not try to achieve random resuming via the API.

Is there an API call for resuming a queue?

No you can make a request to add a switch queue to the API.

Going back to the original question, it turns out I was wrong and the problem wasn’t resolved by switching to Random Stable. So I still have that to work out. It will resume the position within the track it’s playing, but it will always start over from track 1 of the playlist.

The provider proper logs showing that.

I have uploaded a new log under the name “Quaraxkad log2”. I tested both COMMAND:stop and pause. In both cases, resuming the same playlist with MEDIA_START returns to the first track of that playlist. It does resume at the timestamp where that track was last played though.

So yes this actually can’t work for smart playlists sorry.

OK. If it won’t work with a Smart Playlist, would it work with a regular playlist? Can a regular playlist be sorted by random albums?

Or can you think of a different way to accomplish what I’m trying to do? You mentioned the potential for an API call to resume a queue. I think that would get me about 90% of the way there.

I don’t understand the reasoning behind Queues. It seems to me they are just playlists, so why not play tracks “directly” from a playlist, instead of copying the playlist to a queue and then playing the queue?