Bug 8 - ID3v1 or ID3v2.3 genre encoding fails
Summary: ID3v1 or ID3v2.3 genre encoding fails
Alias: None
Product: abcde
Classification: Unclassified
Component: Tagging (show other bugs)
Version: unspecified
Hardware: All All
: Normal normal
Assignee: Andrew Strong
Depends on:
Reported: 2015-08-08 19:55 BST by Martin Husemann
Modified: 2015-09-14 09:49 BST (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Martin Husemann 2015-08-08 19:55:04 BST
I am still using some old software that does not grok ID3v2.4 tags, so I have to use ID3TAGV=id3v1 or ID3TAGV=id3v2.3 in my config file.

That causes do_getgenreid() to be used, which sometimes fails to match the genre:

                *)                       return 1 ;;

and in this case does not output anything.

However, the only call to this function is this:

                        # id3v2 v0.1.9 claims to have solved the -c bug, so we m
erge both id3 and id3v2
                        GENREID=$(do_getgenreid "${CDGENRE}")
                        # Set TPE2 in case we have a Various Artists rip.

As you can see, the return value is not used at all, only the output of the subshell counts. If this is empty and we are using id3 as tagger, tagging fails completely (it does not accept an empty argument to -g). With id3v2 it works and we get "unknown" genre 255 as a result.

Wouldn't it be better to make do_getgenreid output 255 in this case? Alternatively, react on the error return and leave out the -g "$GENREID" argument completely?
Comment 1 Andrew Strong 2015-09-07 10:03:30 BST
Hi Martin. It is partly my fault that id3 and id3v2 still linger on in abcde but I am glad to see that there is still some use for the older taggers :).

I have not looked in great detail at the syntax I confess, but a test using id3 to tag with DGENRE showing blank actually generated a 255 error and successfully completed tagging:

id3v1 tag info for 01.Long,_Long_Time_Ago.mp3:
Title  : Long, Long Time Ago             Artist: Javier Navarrette             
Album  : Pan's Labyrinth                 Year: 2006, Genre: Unknown (255)
Comment:                                 Track: 1

Could be as usual that I am missing something here...
Comment 2 Martin Husemann 2015-09-07 19:22:48 BST
I'm not sure what is different in your setup, but basically from the source it is clear that there will be a call to

  id3 ... -g "" ...

and my id3 version fails and does nothing in that case:

[/tmp] martin@night-owl > id3 -t "Ambient Vibration" -a em.rg -A "none" ambient-vibration-2013-04-01-rc1_0708_06.mp3
Title  : Ambient Vibration               Artist: em.rg                         
Album  : none                            Year:     , Genre: Unknown (255)
Comment:                                 Track: 0


[/tmp] martin@night-owl > id3 -g "" -t "Ambient Vibration" -a em.rg -A "none" ambient-vibration-2013-04-01-rc1_0708_06.mp3
id3: No such genre ''.

[/tmp] martin@night-owl > id3 -v
This is id3 v0.15.

Maybe I need a newer id3?
But anyway, why not just replace the "return 1" with "id=255" in do_getgenreid?
Comment 3 Andrew Strong 2015-09-08 09:05:10 BST
OIC, I misunderstood what you were saying :). The change to id=255 looks fair enough and does not appear to upset eyeD3 in particular, which after all is the new default mp3 tagger. 

I have committed the fix and closed this bug but I would be grateful if you could test the fix on your system to confirm:

 1. It works
 2. It does not break anything else :)

Thanks for your time and trouble!!
Comment 4 Andrew Strong 2015-09-11 01:16:07 BST
A final comment: part of the issue is that your version of id3 is a little old, although I am quite happy with a fix that addresses older versions while still keeping new versions happy. See below:

andrew@ilium~$ id3 -V | head -n 1
id3 0.79 (2015030), Copyright (C) 2003, 04, 05, 06, 15 Marc R. Schoolderman

andrew@ilium~$ id3 -t "Testing, Testing" -g "" test.mp3 
andrew@ilium~$ id3v2 -l test.mp3 
id3v1 tag info for test.mp3:
Title  : Testing, Testing                Artist:                               
Album  :                                 Year:     , Genre: Unknown (255)
Comment:                                 Track: 0

Thanks again for the report and the patience waiting for a fix :)
Comment 5 Martin Husemann 2015-09-13 12:36:44 BST
I tested the commited change and it works fine for me (and nothing obvisous broke during my testing).

(I also inquired why pkgsrc is tracking such an old id3 version)

Comment 6 Andrew Strong 2015-09-14 09:49:35 BST
Thanks for double checking :)