dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
680 stars 27 forks source link

[MPRIS] Populate more fields #240

Closed celynw closed 10 months ago

celynw commented 10 months ago

I am happy to have found this project, and I'm pleased with the recently-added MPRIS support. Thanks!

I noticed the MPRIS spec (spefically, Xesam) has some additional fields which aren't being used. A couple of them can be populated quite easily as this information is already available through subsonic and within supersonic.

https://github.com/dweymouth/supersonic/blob/9b2fee47f1bb566d433c613c9ab3d30fe3b27d75/backend/mediaprovider/model.go#L53-L73

Easy to add:

I have a fork which implements this (it's simple enough for a first-time go user!). I would be interested to know if this is something I can contribute to. But also, to 'finish the job', I'm interested in some of the other empty MPRIS fields:

Side note: I can't find a reference of what subsonic's getSong is actually supposed to return! There's the subsonic api reference which doesn't link to what <song> is, and the openSubsonic documentation but it's not written yet

dweymouth commented 10 months ago

Thanks for reporting this! Also, please do open a pull request for the useCount and contentCreated fields - as you mention we can easily fill those from the existing metadata. The rest, except for lyrics which isn't implemented yet in Supersonic, aren't exposed by the Subsonic API, though if the OpenSubsonic extensions ever move forward, there's the possibility some of those will be available later.

As for the getSong Subsonic endpoint, it returns the metadata for an individual track. The official API specification is light on details as you can see, but each endpoint has an example response that is helpful when trying to understand what the API call actually returns.

celynw commented 10 months ago

Got it, thanks!