mediafile icon indicating copy to clipboard operation
mediafile copied to clipboard

POPM (popularity meter) tag support

Open jmbannon opened this issue 1 year ago • 4 comments

POPM seems to be the standard tag used for ratings across many music apps. This PR adds support for this tag.

Closes https://github.com/beetbox/mediafile/issues/23

jmbannon avatar Jul 24 '24 01:07 jmbannon

Summoning @sampsyo @JOJ0 for a review 🙂

jmbannon avatar Jul 24 '24 16:07 jmbannon

Hi @jmbannon sorry for a little late reply. Basically I think it's about time this tag gets integrated in mediafile. Great!

maybe you can put as much context into the PR description as possible, for documentation purposes. I'm actually not sure if this repo has it's own changelog and how it's documented, so my only idea is to put as much as possible in the PR's description. I know you linked to the issue, but maybe copy over everything that is really relevant/true/worth knowing about his change. Which programs use this tag (eg Traktor I read, what else?), link to the docs on id3.org and so on.

And then there is something @Wolkenarchitect mentioned which I don't entirely understand: https://github.com/beetbox/mediafile/issues/23#issuecomment-571804333 Is that relevant? AFAIS you implemented a basic tag that is a an integer? Is that enough?

JOJ0 avatar Aug 03 '24 07:08 JOJ0

Ah, found it, there actually is a changelog: https://mediafile.readthedocs.io/en/latest/#changelog and this is the source: https://github.com/beetbox/mediafile/edit/master/docs/index.rst

But it seems like @sampsyo did additions to that log in the past when pushing out a release. So not sure if you should add to it within this PR

JOJ0 avatar Aug 03 '24 07:08 JOJ0

Collecting some info about this tag and how other taggers/software implement it:

Basically the POPM tag looks like this:

emailaddress: "value", rating: int 0-255 ,count: int

  • there can be more than one POPM tag in a file.
  • count is optional

mp3tag

  • https://docs.mp3tag.de/mapping/#popularimeter
  • https://community.mp3tag.de/t/ratings-in-mp3tag-where-stored-how-to-display-1-5-star-values/64303/8
  • https://community.mp3tag.de/t/popularimeter-tag/2826

puddletag

  • https://docs.puddletag.net/source/id3.html#field-popularimeter-frame-popm

exiftool

  • https://exiftool.org/forum/index.php?topic=4699.msg22670#msg22670 FIXME changelog?

windows explorer

  • https://www.mediamonkey.com/forum/viewtopic.php?p=450818&hilit=popm#p450818

mediamonkey

  • mp3tag supports the slightly different mediamonkey implementation as well: https://docs.mp3tag.de/mapping/#rating-mm -> shouldn't bother us in mediafile.

translating scales

there seems to be discrepancies bertween translation of the 0-255 rating value to other scales in different tools, but that shouldn't bother the implementation of the actual POPM tag, it's simply 0-255 integer:

  • https://www.mediamonkey.com/forum/viewtopic.php?p=450821#p450821

issuecomment @wolkenarchitect

  • https://github.com/beetbox/mediafile/issues/23#issuecomment-571804333
  • http://id3.org/id3v2.3.0#Popularimeter (Attention: This website is not reachable often from my experience, but it is still existing. I could access it a couple of days ago.)
  • archive.org id3v3 alternative link: https://ia804507.us.archive.org/17/items/id3v2.3.0/id3v2.3.0.html
  • definition copied from the id3.org (textfile):
4.18.   Popularimeter

   The purpose of this frame is to specify how good an audio file is.
   Many interesting applications could be found to this frame such as a
   playlist that features better audiofiles more often than others or it
   could be used to profile a person's taste and find other 'good' files
   by comparing people's profiles. The frame is very simple. It contains
   the email address to the user, one rating byte and a four byte play
   counter, intended to be increased with one for every time the file is
   played. The email is a terminated string. The rating is 1-255 where
   1 is worst and 255 is best. 0 is unknown. If no personal counter is
   wanted it may be omitted.  When the counter reaches all one's, one
   byte is inserted in front of the counter thus making the counter
   eight bits bigger in the same away as the play counter ("PCNT").
   There may be more than one "POPM" frame in each tag, but only one
   with the same email address.

     

     Email to user    $00
     Rating          $xx
     Counter         $xx xx xx xx (xx ...)

maybe that's offtopic, MP4 in mutagen's implementation

has a rtng aka rating tag that is just an integer:

  • https://mutagen.readthedocs.io/en/latest/api/mp4.html#mutagen.mp4.MP4Tags

JOJ0 avatar Feb 01 '25 05:02 JOJ0