Getting genre name of id3v1

The place for "I can't figure out how to..." questions.
Post Reply
appeland
User
Posts: 1
Joined: Wed Aug 16, 2006 10:14 am

Getting genre name of id3v1

Post by appeland » Wed Aug 16, 2006 10:19 am

Hello,
I am trying to get the genre name of the id3v1 tags, but I keep getting the ID back :?: .
Would anyone know how to do this properly ?
Currently trying:
@$ThisFileInfo['tags']['id3v1']['genre'][0];

(using the basic demo)

Thanks and Regards,
Andi

James Heinrich
getID3() v1 developer
Posts: 1476
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Post by James Heinrich » Wed Aug 16, 2006 11:31 am

If you're specifically looking for the text genre of the ID3v1 tag, it would be in

Code: Select all

@$ThisFileInfo['id3v1']['genre'];
If you run demo.browse.php you can explore the whole returned structure and figure out where best to pull the values from for your needs.

vollmerk
User
Posts: 18
Joined: Wed Jun 14, 2006 9:42 pm

id3v2 genre has int value after upgrade to 1.7.7 from 1.7.5

Post by vollmerk » Thu Oct 19, 2006 5:24 am

I just upgraded from 1.7.5 --> 1.7.7 and I noticed that a vast majority of my audio files now return a int value for their genre or a combination of int + human readable name. I've linked a full var output from the getid3() results the id3v1 tag looks ok, however the v2 tag includes a (17) in front of the 'Rock' genre. Currently I 'hack' the (\d) out of the front of the genre however this doesn't help with files that _only_ list the int genre value.

Am I doing something wrong?

Full Output

-Karl Vollmer
Ampache Lead Developer

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Re: id3v2 genre has int value after upgrade to 1.7.7 from 1.

Post by Allan Hansen » Thu Oct 19, 2006 10:52 am

vollmerk wrote:I just upgraded from 1.7.5 --> 1.7.7 and I noticed that a vast majority of my audio files now return a int value for their genre or a combination of int + human readable name. I've linked a full var output from the getid3() results the id3v1 tag looks ok, however the v2 tag includes a (17) in front of the 'Rock' genre. Currently I 'hack' the (\d) out of the front of the genre however this doesn't help with files that _only_ list the int genre value.

Am I doing something wrong?
Can you host or email a sample file? ah at artemis dot dk

vollmerk
User
Posts: 18
Joined: Wed Jun 14, 2006 9:42 pm

Post by vollmerk » Thu Oct 19, 2006 11:00 pm

E-mail sent, hopefully you got it :) it was a rather large one. :)

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Fri Oct 20, 2006 9:51 am

vollmerk wrote:E-mail sent, hopefully you got it :) it was a rather large one. :)
Received.

Problem occurs in getID3() 1.7.7, not in 2.0.0b3.
Looking into a fix now.

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Fri Oct 20, 2006 10:00 am

Allan Hansen wrote:Looking into a fix now.
This is actually a major bug.

bugfix:

module.tag.id3v2.php

line 2935 and line 2937

replace content_type with genre, so the lines look like:

TCO genre
TCON genre

vollmerk
User
Posts: 18
Joined: Wed Jun 14, 2006 9:42 pm

Post by vollmerk » Sat Oct 21, 2006 9:55 pm

Thanks for the patch, it worked perfectly :) keep up the good work

Post Reply