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

Support for numeric genres in id3v2 #13

Merged
merged 1 commit into from
Jul 4, 2015
Merged

Conversation

xhenner
Copy link
Contributor

@xhenner xhenner commented Jun 9, 2015

TCON

The 'Content type', which previously was stored as a one byte numeric value
only, is now a numeric string. You may use one or several of the types as
ID3v1.1 did or, since the category list would be impossible to maintain with
accurate and up to date categories, define your own.

References to the ID3v1 genres can be made by, as first byte, enter "("
followed by a number from the genres list (appendix A) and ended with a ")"
character. This is optionally followed by a refinement, e.g. "(21)" or
"(4)Eurodisco". Several references can be made in the same frame, e.g.
"(51)(39)". If the refinement should begin with a "(" character it should be
replaced with "((", e.g. "((I can figure out any genre)" or "(55)((I
think...)". The following new content types is defined in ID3v2 and is
implemented in the same way as the numerig content types, e.g. "(RX)".

I made a partial implentation as, in practice, I've only seen TCON with
one numeric value.

To test it, use the id3v2 tool

% id3v2 -g 79 test.mp3
% id3v2 -l test.mp3| grep TCON
TCON (Content type): Hard Rock (79)
% ./tag test.mp3| grep Genre
Genre: (79)

With the patch :
% go build && ./tag test.mp3| grep Genre
Genre: Hard Rock

@dhowden
Copy link
Owner

dhowden commented Jun 9, 2015

Please merge the two commits, and add some unit tests (to check that the various genre formats are covered).

@xhenner
Copy link
Contributor Author

xhenner commented Jun 9, 2015

ok, will to it tomorrow.
Just a question.

http://en.wikipedia.org/wiki/ID3#List_of_genres

You have defined id3v1Genres up to the 125 code
libid3 and the id3v2 use the genre up to the 147 code
Therefore, I used this list in a new var

Are you ok if I update the id3v1Genres with the 22 additional codes ? or even the full winamp 5.6 list

@dhowden
Copy link
Owner

dhowden commented Jun 14, 2015

I think that we should keep the id3v1Genres as they are, and add a new map for id3v2.

TCON

    The 'Content type', which previously was stored as a one byte numeric value
only, is now a numeric string. You may use one or several of the types as
ID3v1.1 did or, since the category list would be impossible to maintain with
accurate and up to date categories, define your own.

    References to the ID3v1 genres can be made by, as first byte, enter "("
followed by a number from the genres list (appendix A) and ended with a ")"
character. This is optionally followed by a refinement, e.g. "(21)" or
"(4)Eurodisco". Several references can be made in the same frame, e.g.
"(51)(39)". If the refinement should begin with a "(" character it should be
replaced with "((", e.g. "((I can figure out any genre)" or "(55)((I
think...)". The following new content types is defined in ID3v2 and is
implemented in the same way as the numerig content types, e.g. "(RX)".

To test it, use the id3v2 tool

% id3v2 -g 79 test.mp3
% id3v2 -l test.mp3| grep TCON
TCON (Content type): Hard Rock (79)
% ./tag test.mp3| grep Genre
 Genre: (79)

With the patch :
% go build && ./tag test.mp3| grep Genre
 Genre: Hard Rock
@xhenner
Copy link
Contributor Author

xhenner commented Jul 4, 2015

Sorry for the delay
Here's the new patch : one commit, some tests and no merge conflicts with your recent changes

dhowden added a commit that referenced this pull request Jul 4, 2015
Support for numeric genres in id3v2
@dhowden dhowden merged commit 334c710 into dhowden:master Jul 4, 2015
@dhowden
Copy link
Owner

dhowden commented Jul 4, 2015

No worries, that's an awesome patch.

@xhenner xhenner deleted the genre branch July 4, 2015 16:02
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.

2 participants