mono / taglib-sharp

Library for reading and writing metadata in media files
GNU Lesser General Public License v2.1
1.29k stars 312 forks source link

Shouldn't TRCK etc. be a string rather than a UInt? #64

Open cvdevol opened 7 years ago

cvdevol commented 7 years ago

Here is very the beginning of one of my mp3 files. I set the tags using the "mp3tag" application:

ID3.....N.TALB.......01-InfinithityTPE1.......Chris DevolTCON.......RockTIT2.......Hidey HoleTRCK.......01TXXX.......MP3GAIN_MINMAX.137,188TXXX.......MP3GAIN_ALBUM_MINMAX.127,191TXXX.......MP3GAIN_UNDO.+002,+002,NTXXX...#...replaygain_track_gain.-2.710000 dBTXXX.......replaygain_track_peak.0.729617TXXX...#...replaygain_album_gain.-2.980000 dBTXXX.......replaygain_album_peak.1.345866APIC..þ'...image/jpeg..Cover Art (Front).jpg.ÿØÿá.øExif..II*...

It appears that the TRCK tag is a string field, so that there can be leading zeros in the track number. Is there a way in taglib# to set this field as a string instead of as a UInt? In taglib# all the instances of the "Track" property are defined as a UInt.

Starwer commented 7 years ago

In my opinion, the track number should be presented to the user as Uint. But indeed, I agree that not having the leading zeros may be annoying. I'd suggest that the written TRCK tags (as string) are by default a two digit-zero-filled number (01, 02, 03...). I already use this approach in #68 for mkv tags.

cvdevol commented 7 years ago

The problem is that sorting integer-valued track numbers is funky. Having the track numbers as strings padded with leading zeros to make them all the same length makes sorting proper.

Starwer commented 7 years ago

The Integration of #71 gives a good trade-off between Uint use and the alphabetical sorting in the different tagging applications.

Starwer commented 7 years ago

To be more explicit, I recommend to close this issue, as I consider it solved.