Skip to content

Conversation

@jmbannon
Copy link
Contributor

@jmbannon jmbannon commented Jul 24, 2024

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

Closes #23

@jmbannon
Copy link
Contributor Author

Summoning @sampsyo @JOJ0 for a review 🙂

@JOJ0
Copy link
Member

JOJ0 commented Aug 3, 2024

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: #23 (comment)
Is that relevant? AFAIS you implemented a basic tag that is a an integer? Is that enough?

@JOJ0
Copy link
Member

JOJ0 commented Aug 3, 2024

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 JOJ0 self-assigned this Feb 1, 2025
@JOJ0
Copy link
Member

JOJ0 commented Feb 1, 2025

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

puddletag

exiftool

windows explorer

mediamonkey

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:

issuecomment @wolkenarchitect

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:

@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.26%. Comparing base (d2bb1b4) to head (bd1788b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #78   +/-   ##
=======================================
  Coverage   93.26%   93.26%           
=======================================
  Files          16       16           
  Lines         817      817           
  Branches      118      118           
=======================================
  Hits          762      762           
  Misses         35       35           
  Partials       20       20           

@semohr
Copy link
Contributor

semohr commented Dec 11, 2025

@JOJ0 i just rebased this. Thank you for the research around the field!

I think we should probably add a test for the new field before we merge this tho. Might require us to edit the mp3 files in the /tests/rsrc folder.

@JOJ0
Copy link
Member

JOJ0 commented Dec 14, 2025

@JOJ0 i just rebased this. Thank you for the research around the field!

I think we should probably add a test for the new field before we merge this tho. Might require us to edit the mp3 files in the /tests/rsrc folder.

but the current implementation here just defines it as int right? that's not enough to align with the research, it contains email, rating, count

eg mp3tag also talks about these 3 values: https://docs.mp3tag.de/mapping/#popularimeter

@semohr
Copy link
Contributor

semohr commented Dec 17, 2025

Yes you are totally right. Might need its own MediaField type too, I don't think we can easily model this with the current fields.

I still think getting some test files first is a good approach to get this going tho :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to add custom field - ID3 Popularimeter

4 participants