RATING Tag IssuesSee original GitHub issue
Hello, some notes…
I think in the typings, the field ‘rating’ should be an array like:
Next strange thing is, that I have a mp3 file with a rating of 3.
If I read the file with music-metadata, the value is like 2.500000341.
So i have to do a
const rating = Math.round(oldAudioData.metadata.common.rating.rating)
Thanks, and best regards!
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
The track you provided has a POPM field set with a raw value of 128. Where 0 is not rated, 1 worst and 255 is the best rating. So the score is
(128 - 1) / 254 ≈ 0.504.
The rating in Mp3Tag is defined like this:
Track rating from 1 = Bad to 5 = Very good like Windows Media Player does it. You can also enter stars * for rating the track.
That is range of 4 (because 0 is stars is not included). Number of stars is: 1 + 0.504 * 4 ≈ 1 + 2 ≈ 3 stars.
I guess should correct two things
- Add the
(128 - 1) / 254 ≈ 0.504and should be divided by 254 to make the max score inclusive.
- Change the definition of the [0…5] range, because this is very confusing. Maybe [0…1] to be clearly different then the [1…5] star rating.