strawberrymusicplayer / strawberry

:strawberry: Strawberry Music Player
https://www.strawberrymusicplayer.org/
GNU General Public License v3.0
2.74k stars 191 forks source link

Ratings are not saved in flac files #775

Closed MountainX closed 3 years ago

MountainX commented 3 years ago

Describe the bug Ratings information is not saved in file metadata for flac files.

To Reproduce Make a playlist of flac files in Strawberry.

I tested with and without these Metadata settings enabled:

(BTW, is "inline edition" a typo? Should it read "inline editing"?)

Set ratings for one or more files using mouse to click the stars. Save the playlist. (I'm not sure if saving the playlist should be required, but I'm doing that step to be sure.) In further troubleshooting, to be sure, go ahead and exit Strawberry to check the case of a possible save metadata on exit.

Then inspect the file's metadata using one of several tools such as mutagen-inspect, kid3-cli or others.

Here's an example. In Strawberry, I set the rating to 5 stars for this track:

$ mutagen-inspect Curtis_Mayfield/Superfly-1999/11-Superfly_Single_Mix.flac -- Curtis_Mayfield/Superfly-1999/11-Superfly_Single_Mix.flac

The existing rating value (0.55, which was set in another player) was unchanged after I used Strawberry to give it a rating. I specifically rated it 5 of 5 stars in Strawberry to make it clear that a change had occurred. None did.

The settings values I mentioned above do not change the observed behavior.

I tested other flac tracks. Strawberry is never saving the rating metadata to the file. But the ratings are saved somewhere because Strawberry remembers them. However, my usecase requires the ratings be read from and written to the file metadata.

Expected behavior Set a rating for a track and the value will be saved in the file's metadata. I guess I expect it to be saved in a tag with a name similar to "rating".

I am trying out Strawberry in the hopes that it will support a rating scale of 0-100 for flac files, which is somewhat of an informal standard for these types of files.

System Information:

jonaski commented 3 years ago

Strawberry does not read or save ratings from tags. There are no standardized rating tags.

MountainX commented 3 years ago

Strawberry does not read or save ratings from tags.

OK, thanks for making that clear.

There are no standardized rating tags.

FYI: There seems to be two widely used informal standards for Vorbis / FLAC ratings. They are either 0% to 100% (0 to 1.0) or 0 to 100 (integers). Almost every music player I have seen that saves ratings metadata for these file types uses one of these two informal standards.

danutsu commented 2 years ago

Sorry to reopen this discussion but Strawberry definitely can save ratings in tags. There is an option for this under Tools > Settings > Collection > Song playcounts and ratings > Save ratings to song tags when possible.

And yes, it doesn't work for FLAC files, but it could. As MountainX said, most other music players that support FLAC ratings do so using a 0-100 integer or 0.0 to 1.0.

Would you be interested in a PR to fix this? I wouldn't mind helping out as FLAC ratings are an essential part of my collection and I can't use Strawberry right now because of it.

jonaski commented 2 years ago

Worked fine last time I checked

danutsu commented 2 years ago

Ah, I see: Strawberry supports FLAC ratings as the "FMPS_RATING" tag with values between 0.0 and 1.0, but my previous music player (MusicBee) wrote them as RATING, with values between 0 and 100. I guess I'll just convert my library tags to what Strawberry expects.