The Track class code should be updated to ensure that the attributes track_no, track_total, disc_no, and disc_total are properly set as integers values, even if the values are not present in the id3 tags.
A default disc_no or disc_total value should be 1 if not specified, assuming that the CD came on a single physical disc.
A default track_no and track_total value should be 0; which is technically an invalid value, but it satisfies our need to have a value for sorting. An editing flag should be added to the XML to signify that there are invalid track numbers.
Integer value check was put in a separate class method to keep the code distinct, and easier to modify. The Track class code is likely to change in the future.
We're casting the values passed from TinyTag into integers, but there is a chance they could already be integers, depending on the version of TinyTag.
The
Track
class code should be updated to ensure that the attributestrack_no
,track_total
,disc_no
, anddisc_total
are properly set as integers values, even if the values are not present in the id3 tags.A default
disc_no
ordisc_total
value should be 1 if not specified, assuming that the CD came on a single physical disc.A default
track_no
andtrack_total
value should be 0; which is technically an invalid value, but it satisfies our need to have a value for sorting. An editing flag should be added to the XML to signify that there are invalid track numbers.