Symfonium APP additional playlist management features

Hi

Would be great if you could add some additional features into the available API, to manage playlists.

  1. Ask Sym to add trackX to current playing playlist
  2. Be able to query Sym for the current playing track

Then it would be possible to build “bridge” plugins that reach out to various music recommendation services and use that to ask Sym to queue a track.

Thanks

Next version will have a queue option to the play api.

For the current playing Symfonium publish everything as media session that can be accessed from apps like tasker to have everything.

2 Likes

Hi Tolriq, hope you are doing well. I’ve been playing around with the API and its working great, thank you so much for that. I’m stuck on how to access Symf Media session though to pick up the current playing track, is there any test code you could share at all on how to get this?

I was looking at a simple Android app that injects into Symf’s queue, unless there is a better way you recommend?

Thanks in advance

I would use Tasker :slight_smile:

But if you want to go Android app then GitHub - googlesamples/android-media-controller shows how to detect media sessions and interact with them.


Thanks I had a look at the metadata, with Rocket Player it shows the media_id with the track filepath which is perfect but with Sym it just shows current_playlist/0 any ideas?

This is an internal Id with no real meaning. The other fields have the media info.

Hi, sorry another question :slight_smile:

Trying to add a track to the queue but I can’t seem to get the encoding right, is there anything specific I need to do? Various examples below, I tired matching what was in debug.log but that didn’t work either;

            String my_track = "file:///%2Fstorage%2F9C33-6BBD%2FMusic%2FVarious%20Artists%2FBest%20of%202017%2F61%20-%20Best%20of%202017%20(Danny%20Serrano%20Mixtape)%20-%20Danny%20Serrano.mp3";
            AddtoQueue(my_track);
            String my2_track = "file:////storage//9C33-6BBD//Music//Placebo//(2015) Placebo - MTV Unplugged//07 - Meds.mp3";
            AddtoQueue(my2_track);
            String my3_track = "/storage/9C33-6BBD/Music/Placebo/(2015) Placebo - MTV Unplugged/07 - Meds.mp3";
            AddtoQueue(my3_track);


private void AddtoQueue(String track) {
    Intent i = new Intent();
    i.setComponent(new ComponentName("app.symfonik.music.player", "app.symfonium.remote.api.ApiReceiver"));
    i.setAction("app.symfonium.api.MEDIA_START");
    i.putExtra("MEDIA_TYPE", "song");
    i.putExtra("NAME", track);
    i.putExtra("QUEUE", 2);
    i.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
    sendBroadcast(i);
}

I tried a song with no special encoding and I just get this in the debug log (same error msg obvious track name varies);

2022-09-03 22:32:13.991 Verbose/QueryBuilder: Query: SELECT songs._id,songs.updated_at,songs.provider_id,songs.external_id,songs.external_data,songs.album_id,songs.date_added,songs.disc,songs.display_artist,songs.duration,songs.fanart,songs.file,songs.genres,songs.last_played,songs.lyrics,songs.offline_status,songs.play_count,songs.rating,songs.sort_title,songs.thumbnail,songs.title,songs.track,songs.year,songs.user_rating,songs.is_favorite,songs.source_library,songs.remote_play,songs.resume_point,CASE WHEN songs.thumbnail IS NULL THEN albums.thumbnail ELSE songs.thumbnail END,albums.title FROM songs LEFT JOIN albums ON (songs.album_id=albums._id) WHERE (songs.title LIKE ?) (‘/storage/9C33-6BBD/Music/Yuna/Yuna/05 - Planes.mp3’) [0 in 41.43ms]
2022-09-03 22:32:13.994 Verbose/ApiReceiver: Song not found: /storage/9C33-6BBD/Music/Yuna/Yuna/05 - Planes.mp3

Thanks

As the doc and log says you need to pass the title of the media not the file name.

EDIT: Next release will have a FILE parameter that take the file as your my3_track format.

Thanks Tolriq, passing the title did work (e.g. Winter Wonderland) but ended up loading 8x different renditions into the queue :rofl:

Hi Tolriq

Me again :slight_smile: So I hired a coder to help as I couldn’t figure it out and they were not able to pull the current playing filename uri out of the media session data either.

Is it possible to exposure this, or add the current playing track into the API and I’ll just poll every 30 seconds to see if its the same track or has changed?

Thanks in advance

Without details on what they do it’s hard to understand the need.

The media session expose the track id track name, the playlist position and everything. You can already detect the media change without any issue.

Filename is not exposed as it can contains private information like user/password that anyone could read.

Hey Tolriq, Just the path and filename as its guaranteed unique, only for local files (e.g. /storage/C233-834B/Music/Boards of Canada/(2013) Tomorrow’s Harvest/14 - Sundown.mp3)

Happy to donate to a charity of you/your choice

Things needs to be consistent for everything not just some special case.

You still do not explain why you need that data and why you need it to be unique? You can queue the same file multiple times, there’s nothing unique then.

To enable Symf to reach out to other music services, the filename is the most stable element which can be passed to another process to pull out a lot of other tag information not available in Symf, e.g. AcoustIDs, MusicMagic Fingerprints, BeaTunes Color, BeaTunes Spectrum, EnergyLevel, Danceability, Mood etc. then using those data fields with fingerprinting products like BeaTunes, MusicIP, Mixed in Key to decide the next track to play.

Therefore going beyond the play album A, play genre B “staticness” of music playing. Hence being able to pull out the filename opens up a lot of future opportunities

Well the thing is that none of those services works from a filename. They all require passing the actual details.

On one hand you have a filename that can be named anything with the data impossible to extract from it. Including for some providers not even the actual real filename.
On the other hand you have the precise metadata to precisely identify the media and call those services.

You are turning around your actual need and global design and everyone is loosing time because no one can help you design your solution properly.

I suppose you have some special thing on your side that is ultra specific and in that case you can also handle hashes or something else to identify the file.