Skip Menu |

This queue is for tickets about the MP3-Info CPAN distribution.

Report information
The Basics
Id: 2443
Status: new
Priority: 0/
Queue: MP3-Info

People
Owner: Nobody in particular
Requestors: lj [...] dcs.ed.ac.uk
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.02
Fixed in: (no value)

Attachments


Subject: Patch to overlay proper tracknumbers when id3v2 is of the form m/n
Some encoders (itunes, for instance) write the id3v2 tracknumber field as 1/n, 2/n, etc. where n is the number of tracks on the cd. As far as I can tell, perl interprets this as a string representation of a fraction, and then rounds it to integer, so that all the track numbers are 0 or 1. This patch chops off the tail of the tracknumber string, leaving only the number (and not the "/n") before writing it over the id3v1 value.
Download Info.pm.diff.2.2
application/octet-stream 445b

Message body not shown because it is not plain text.

[guest - Sun Apr 27 11:17:12 2003]: Show quoted text
> Some encoders (itunes, for instance) write the id3v2 tracknumber field > as 1/n, 2/n, etc. where n is the number of tracks on the cd. > > As far as I can tell, perl interprets this as a string representation > of a fraction, and then rounds it to integer, so that all the track > numbers are 0 or 1. > > This patch chops off the tail of the tracknumber string, leaving only > the number (and not the "/n") before writing it over the id3v1 value.
Oh, you mean "perl interprets this as a string representation" specifically when writing ID3v1?
[CNANDOR - Sun Apr 27 11:27:04 2003]: Show quoted text
> [guest - Sun Apr 27 11:17:12 2003]: >
> > Some encoders (itunes, for instance) write the id3v2 tracknumber
> field
> > as 1/n, 2/n, etc. where n is the number of tracks on the cd. > > > > As far as I can tell, perl interprets this as a string
> representation
> > of a fraction, and then rounds it to integer, so that all the track > > numbers are 0 or 1. > > > > This patch chops off the tail of the tracknumber string, leaving
> only
> > the number (and not the "/n") before writing it over the id3v1
> value. > > Oh, you mean "perl interprets this as a string representation" > specifically when writing ID3v1?
Sorry for not being clear. This is when the calling app calls get_mp3tag without setting version. When version=2, it returns the id3v2 as a string, and with version = 1 it returns the id3v1 as an integer. The problem comes when it tries to return the id3v2 string as an integer.
[guest - Sun Apr 27 11:53:55 2003]: Show quoted text
> This is when the calling app calls get_mp3tag without setting version. > When version=2, it returns the id3v2 as a string, and with version = 1 > it returns the id3v1 as an integer. The problem comes when it tries to > return the id3v2 string as an integer.
As best I can tell, it doesn't return it as an integer. Your caller may *treat* it as an integer, and that is worth a documentation patch, but I don't see a problem with returning the track number as "n/m".
[CNANDOR - Sun Apr 27 13:34:21 2003]: Show quoted text
> [guest - Sun Apr 27 11:53:55 2003]: >
> > This is when the calling app calls get_mp3tag without setting > > version. When version=2, it returns the id3v2 as a string, and with > > version = 1 it returns the id3v1 as an integer. The problem comes > > when it tries to return the id3v2 string as an integer.
> > As best I can tell, it doesn't return it as an integer. Your caller > may *treat* it as an integer, and that is worth a documentation patch, > but I don't see a problem with returning the track number as "n/m".
A problem I can see is that calling get_mp3tag without specifying a version is most likely to happen with legacy programs, which are the least likely to be able to cope with getting a string as a track number. I don't understand perl's typing philosophy very well, so I could be very wrong.