Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trial and error genre not genres dependant #81

Closed
wants to merge 1 commit into from
Closed

Trial and error genre not genres dependant #81

wants to merge 1 commit into from

Conversation

JOJ0
Copy link
Member

@JOJ0 JOJ0 commented Jan 27, 2025

Just some trial and error approach for now. Details later.

Todo: Investigate what the default name for genre tag is according to whoever invented it and if it is common to use a "genres" plural tag as well (I guess not and wonder how difficult it is to find out what is contained in a genre tag - a list or a string, ....) Investigate, investigate more....

Read this for newer tags: https://id3.org/id3v2.4.0-frames

Read maybe this for older tags:

Links source: https://en.wikipedia.org/wiki/ID3#References

@JOJ0 JOJ0 changed the title Trial and error genre not genres dependent Trial and error genre not genres dependant Jan 27, 2025
@JOJ0
Copy link
Member Author

JOJ0 commented Jan 27, 2025

Todo: Investigate what the default name for genre tag is according to whoever invented it and if it is common to use a "genres" plural tag as well (I guess not and wonder how difficult it is to find out what is contained in a genre tag - a list or a string, ....) Investigate, investigate more....

The genre tag's official name is difficult to find....no luck so far. I think there is no real definition. Naming it "GENRE" is just what people use. Update 30 minutes later: looking for genre is misleading since the tags actual name is TCON

ID3v2.4 introduces a definition for lists to be saved as strings with NULL characters separated.

In case of ID3v2.3 obviously there is no definition for lists. It can only be a string. Any list handling must be done on another (higher) level.

So to answer my own questions:

More questions

  • Not sure how mediafile saves a list to the file (beets supports id3v2.3 and 2.4 as well, IIRC) and whether it uses the NULL character or a self-defined delimieter (to stay 2.3 compatible)-> read the fine code....
  • Still it's confusing to me that we write to a property that is named plural genres, and then there is a singular genre property, that has not really a purpose (from reading code it should be able read and write the very first entry of genre - in the case of genre, this does not really make sense:

    mediafile/mediafile.py

    Lines 1303 to 1306 in e1de364

    def single_field(self):
    """Returns a ``MediaField`` descriptor that gets and sets the
    first item.
    """
  • Has the NULL character we use in beets as the list delimiter anything to do with the id3v2.4 delimiter? Or do we abstract that anyway and it was "just chosen" in beets for whatever reason.

Maybe genre and genres mediafile properties should indeed be synonyms, or even better, one of them removed.

genre = genres.single_field()

genre = MediaField(
MP3StorageStyle('genre'),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually wrong. should be TCON, if genre should be a "simple string version" of genres plural.

@JOJ0
Copy link
Member Author

JOJ0 commented Feb 1, 2025

This was just an experiment. Some useful research on id3 tags in there though. Closing.

@JOJ0 JOJ0 closed this Feb 1, 2025
@JOJ0 JOJ0 deleted the genre branch February 1, 2025 05:23
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.

1 participant