epoupon / lms

Lightweight Music Server. Access your self-hosted music using a web interface.
http://lms-demo.poupon.dev
GNU General Public License v3.0
1.07k stars 59 forks source link

[Question] `bitrate` missing in songs #363

Closed GioF71 closed 9 months ago

GioF71 commented 10 months ago

Hello again, when using the subsonic python library py-sonic, I notice that the key 'bitrate' is missing from the 'song' dictionary. Example, when you pick a random song. This information is usually available when using navidrome or gonic. Would it be possible to add this detail to the data structure?

Thank you

epoupon commented 10 months ago

Yes it is possible to add this!

GioF71 commented 10 months ago

Thank you. Will be waiting. Before I open other issuse if this is something not possible... would you consider adding information about the sampling rate and the bit depth? Thanks again

epoupon commented 10 months ago

Well lms uses taglib so this is available: https://taglib.org/api/classTagLib_1_1AudioProperties.html Looks like bit depth is exposed only for some formats though. That being said, extra fields should be normalized/adopted at the OpenSubsonic level (see https://github.com/opensubsonic/open-subsonic-api)

GioF71 commented 10 months ago

Yes, Bit depth is probably missing for lossy formats (it's meaningless in that case). In any case it would be nice to have these fields exposed when they are relevant for the specific song (as an audio file).

epoupon commented 10 months ago

Yes indeed, but as AFAIU you need these info using the subsonic API?

GioF71 commented 10 months ago

Yes I would like them very much, but not only from lms, they should be supported across all the opensubsonic server, in order to be able to build applications that can consistently show that kind of information.

epoupon commented 10 months ago

Ok then you should request these fields at the open subsonic github, I will gladly add them on lms afterwards.

GioF71 commented 10 months ago

Ok sure, will do. Just to confirm, will you be adding the bitrate, which is already in the standard api? Also the contentType is missing currently, do I need to create a separate issue for this as well? Thank you!

epoupon commented 10 months ago

Ok sure, will do. Just to confirm, will you be adding the bitrate, which is already in the standard api?

Yes!

Also the contentType is missing currently, do I need to create a separate issue for this as well? Thank you!

I will add it in referring the same issue

GioF71 commented 10 months ago

Awesome, thank you!

GioF71 commented 10 months ago

I have created this discussion on the opensubsonic repository. If this is accepted, then it would be also nice to have there informations (maybe in form of a list, considering that some release of the same albums include files with different bitDepth and samplingRates). But in any case, this would come next. If you have some suggestion for the formulation of the discussion, please comment and I will update it.

Thank you.

epoupon commented 9 months ago

I added the fields in the Subsonic API. Bitrates were already displayed in the web interface, but now for an album this is the mean bitrate of the tracks, as the bitrate of a track may already be a mean bitrate.

considering that some release of the same albums include files with different bitDepth and samplingRates

About that, several releases of the same albums should be scanned as separate albums by LMS since they have different release MBID, and then they will have different ids in the subsonic API. I planned to better identify release groups (see https://musicbrainz.org/doc/Release_Group) but I still have to think about a sleek way to expose this concept in the UI.

GioF71 commented 7 months ago

Hello, about this discussion on opensubsonic: https://github.com/opensubsonic/open-subsonic-api/discussions/64 I do not really understand if I need to do some specific activity there so that it has the chance to become part of the api. I do not understand if the change is accepted or not. Can you give me a hint? Thank you!

epoupon commented 7 months ago

Hello ! I think since there is no objection, the next step is to make a PR with the proposed changes