Jump to content

Current Playlist using Tasker


Recommended Posts

This is something I've been trying on and off for a long time in Tasker, and always felt like I was almost there, but never quite.

What I want to do is get the ID of the playlist that the most recent track was played from (if any). 

I can get the ID (folder_files._id) of the last played track from content://com.maxmpz.audioplayer.data/files?lim=1 (ordered by folder_files.played_at desc). The problem is that track may appear in more than one playlist, so they can't just be joined to playlist_entries on _id. Logically it should be possible to use the played_at column to then match the track in playlist_entries, but, it seems that played_at gets updated immediately in folder_files, but not in playlist_entries, so it's always a step behind, and with the possibility of of playlists having been changes etc it's not a reliable method of getting the playlist.

Does anyone know how this can be done? I'm not seeing any other fields that could be used to tie the most recently played track in folder_files to playlist_entries. I assume this can be done because the required info is displayed in the track info bundle exposed by an intent when tracks change, but I just can't quite get there...


Link to comment
Share on other sites

9 hours ago, papete said:

I think you have you have your answer in your question. Why don't you set a variable where you extract the playlist info from the track changed intent? 

That is the way I do it currently, but that method relies on an intent being received, which only happens in certain circumstances. I'd like to be able to query Poweramp at any time, which should be possible I think.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...