Skip to content

Commit 5ff849a

Browse files
committed
Track number is now a string internally, and can be accessed with Track.TrackNumberStr
1 parent 16a475d commit 5ff849a

21 files changed

+175
-53
lines changed

ATL.unit-test/IO/HighLevel.cs

+51
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,57 @@ private int getMP4DateFieldLength(Stream s)
13731373
return StreamUtils.DecodeBEInt32(buffer);
13741374
}
13751375

1376+
[TestMethod]
1377+
public void TagIO_RW_Track_Number_Str_Num()
1378+
{
1379+
// Using VorbisTag as it allows storing track numbers as strings
1380+
var emptyFile = "OGG/empty.ogg";
1381+
1382+
// == 1- Add a numeric track number to an empty file
1383+
string testFileLocation = TestUtils.CopyAsTempTestFile(emptyFile);
1384+
Track theTrack = new Track(testFileLocation);
1385+
1386+
theTrack.TrackNumber = 2;
1387+
Assert.IsTrue(theTrack.Save());
1388+
1389+
theTrack = new Track(testFileLocation);
1390+
Assert.AreEqual(2, theTrack.TrackNumber);
1391+
Assert.AreEqual("2", theTrack.TrackNumberStr);
1392+
1393+
// Get rid of the working copy
1394+
if (Settings.DeleteAfterSuccess) File.Delete(testFileLocation);
1395+
1396+
1397+
// == 2- Add a string track number to an empty file
1398+
testFileLocation = TestUtils.CopyAsTempTestFile(emptyFile);
1399+
theTrack = new Track(testFileLocation);
1400+
1401+
theTrack.TrackNumberStr = "02";
1402+
Assert.IsTrue(theTrack.Save());
1403+
1404+
theTrack = new Track(testFileLocation);
1405+
Assert.AreEqual(2, theTrack.TrackNumber);
1406+
Assert.AreEqual("02", theTrack.TrackNumberStr);
1407+
1408+
// Get rid of the working copy
1409+
if (Settings.DeleteAfterSuccess) File.Delete(testFileLocation);
1410+
1411+
1412+
// == 3- Add an LP string track number to an empty file
1413+
testFileLocation = TestUtils.CopyAsTempTestFile(emptyFile);
1414+
theTrack = new Track(testFileLocation);
1415+
1416+
theTrack.TrackNumberStr = "A2";
1417+
Assert.IsTrue(theTrack.Save());
1418+
1419+
theTrack = new Track(testFileLocation);
1420+
Assert.AreEqual(2, theTrack.TrackNumber);
1421+
Assert.AreEqual("A2", theTrack.TrackNumberStr);
1422+
1423+
// Get rid of the working copy
1424+
if (Settings.DeleteAfterSuccess) File.Delete(testFileLocation);
1425+
}
1426+
13761427
[TestMethod]
13771428
public void TagIO_RW_WriteSpecificTagType()
13781429
{

ATL.unit-test/IO/MetaData/ID3v1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public ID3v1()
2626
testData.Comment = "Test!";
2727
testData.Date = DateTime.Parse("01/01/2017");
2828
testData.Genre = "Bluegrass";
29-
testData.TrackNumber = 22;
29+
testData.TrackNumber = "22";
3030
}
3131

3232
[TestMethod]

ATL.unit-test/IO/MetaData/ID3v2.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void TagIO_R_ID3v22_simple()
6060
Assert.AreEqual("I have no IDE and i must code", theFile.ID3v2.Comment);
6161
Assert.AreEqual(1997, theFile.ID3v2.Date.Year);
6262
Assert.AreEqual("House", theFile.ID3v2.Genre);
63-
Assert.AreEqual(1, theFile.ID3v2.TrackNumber);
63+
Assert.AreEqual("1", theFile.ID3v2.TrackNumber);
6464
Assert.AreEqual(2, theFile.ID3v2.TrackTotal);
6565
Assert.AreEqual("COMP!", theFile.ID3v2.Composer);
6666
Assert.AreEqual(2, theFile.ID3v2.DiscNumber);
@@ -109,7 +109,7 @@ public void TagIO_R_ID3v22_UTF16()
109109
Assert.AreEqual("I have no IDE and i must code bébé 父", theFile.ID3v2.Comment);
110110
Assert.AreEqual(1997, theFile.ID3v2.Date.Year);
111111
Assert.AreEqual("House", theFile.ID3v2.Genre);
112-
Assert.AreEqual(1, theFile.ID3v2.TrackNumber);
112+
Assert.AreEqual("1", theFile.ID3v2.TrackNumber);
113113
Assert.AreEqual(2, theFile.ID3v2.TrackTotal);
114114
Assert.AreEqual("COMP!", theFile.ID3v2.Composer);
115115
Assert.AreEqual(2, theFile.ID3v2.DiscNumber);
@@ -1068,7 +1068,7 @@ public void TagIO_R_ID3v2_HugeTrackAlbumNum()
10681068

10691069
// Supported fields
10701070
Assert.AreEqual(0, theFile.ID3v2.DiscNumber);
1071-
Assert.AreEqual(0, theFile.ID3v2.TrackNumber);
1071+
Assert.AreEqual("90000A", theFile.ID3v2.TrackNumber);
10721072
}
10731073

10741074
[TestMethod]

ATL.unit-test/IO/MetaData/MP4.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public MP4()
6666
titleFieldCode = "©nam";
6767

6868
// MP4 does not support leading zeroes
69-
testData.TrackNumber = 1;
69+
testData.TrackNumber = "1";
7070
testData.TrackTotal = 2;
7171
testData.DiscNumber = 3;
7272
testData.DiscTotal = 4;

ATL.unit-test/IO/MetaData/MetaIOTest.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected MetaIOTest()
6868
testData.Date = DateTime.Parse("1997-06-20T04:04:04");
6969
testData.Genre = "House";
7070
testData.Popularity = null;
71-
testData.TrackNumber = 1;
71+
testData.TrackNumber = "01";
7272
testData.TrackTotal = 2;
7373
testData.Composer = "ccᱬdd";
7474
testData.Conductor = ""; // Empty string means "supported, but not valued in test sample"
@@ -429,7 +429,7 @@ public void test_RW_Empty(
429429
if (testData.PublishingDate > DateTime.MinValue) theTag.PublishingDate = DateTime.Parse("2007/02/02");
430430
if (testData.Genre != "") theTag.Genre = "Merengue";
431431
if (testData.Popularity != 0) theTag.Popularity = 2.5f / 5;
432-
if (testData.TrackNumber != 0) theTag.TrackNumber = 1;
432+
if (testData.TrackNumber != null && testData.TrackNumber != "") theTag.TrackNumber = "1";
433433
if (testData.TrackTotal != 0) theTag.TrackTotal = 2;
434434
if (testData.DiscNumber != 0) theTag.DiscNumber = 3;
435435
if (testData.DiscTotal != 0) theTag.DiscTotal = 4;
@@ -510,7 +510,7 @@ public void test_RW_Empty(
510510
}
511511
if (testData.Genre != "") Assert.AreEqual("Merengue", meta.Genre);
512512
if (testData.Popularity != 0) Assert.AreEqual(2.5f / 5, meta.Popularity);
513-
if (testData.TrackNumber != 0) Assert.AreEqual(1, meta.TrackNumber);
513+
if (testData.TrackNumber != null && testData.TrackNumber != "") Assert.AreEqual("1", meta.TrackNumber);
514514
if (testData.TrackTotal != 0) Assert.AreEqual(2, meta.TrackTotal);
515515
if (testData.DiscNumber != 0) Assert.AreEqual(3, meta.DiscNumber);
516516
if (testData.DiscTotal != 0) Assert.AreEqual(4, meta.DiscTotal);
@@ -856,7 +856,7 @@ protected void readExistingTagsOnFile(AudioDataManager theFile, int nbPictures =
856856
if (testData.Genre != "") Assert.AreEqual(testData.Genre, meta.Genre);
857857
if (testData.Composer != "") Assert.AreEqual(testData.Composer, meta.Composer);
858858
if (testData.Popularity != 0) Assert.AreEqual(testData.Popularity, meta.Popularity);
859-
if (testData.TrackNumber != 0) Assert.AreEqual(testData.TrackNumber, meta.TrackNumber);
859+
if (testData.TrackNumber != null && testData.TrackNumber != "") Assert.AreEqual(testData.TrackNumber, meta.TrackNumber);
860860
if (testData.TrackTotal != 0) Assert.AreEqual(testData.TrackTotal, meta.TrackTotal);
861861
if (testData.DiscNumber != 0) Assert.AreEqual(testData.DiscNumber, meta.DiscNumber);
862862
if (testData.DiscTotal != 0) Assert.AreEqual(testData.DiscTotal, meta.DiscTotal);

ATL.unit-test/IO/MetaData/SPC.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void TagIO_RW_SPC_Empty()
7777
theTag.Artist = "Artist";
7878
theTag.Comment = "This is a test";
7979
theTag.Date = DateTime.Parse("01/01/2008");
80-
theTag.TrackNumber = 1;
80+
theTag.TrackNumber = "1";
8181
theTag.TrackTotal = 1;
8282
theTag.DiscNumber = 2;
8383

@@ -94,7 +94,7 @@ public void TagIO_RW_SPC_Empty()
9494
Assert.AreEqual("Artist", theFile.NativeTag.Artist);
9595
Assert.AreEqual("This is a test", theFile.NativeTag.Comment);
9696
Assert.AreEqual(2008, theFile.NativeTag.Date.Year);
97-
Assert.AreEqual(1, theFile.NativeTag.TrackNumber);
97+
Assert.AreEqual("1", theFile.NativeTag.TrackNumber);
9898
Assert.AreEqual(2, theFile.NativeTag.DiscNumber);
9999

100100
// Remove the tag and check that it has been indeed removed
@@ -267,7 +267,7 @@ private void readExistingTagsOnFile(AudioDataManager theFile, string publisherSt
267267
Assert.AreEqual("Yasunori Mitsuda", theFile.NativeTag.Artist);
268268
Assert.AreEqual("", theFile.NativeTag.Comment);
269269
Assert.AreEqual(1995, theFile.NativeTag.Date.Year);
270-
Assert.AreEqual(23, theFile.NativeTag.TrackNumber);
270+
Assert.AreEqual("23", theFile.NativeTag.TrackNumber);
271271
Assert.AreEqual(2, theFile.NativeTag.DiscNumber);
272272
Assert.AreEqual(publisherStr, theFile.NativeTag.Publisher);
273273

ATL.unit-test/IO/MetaData/VQF.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void TagIO_RW_VQF_Empty()
8181
theTag.Comment = "This is a test";
8282
theTag.Date = DateTime.Parse("01/01/2008");
8383
theTag.Genre = "FPS";
84-
theTag.TrackNumber = 22;
84+
theTag.TrackNumber = "22";
8585
theTag.TrackTotal = 23;
8686

8787
// Add the new tag and check that it has been indeed added with all the correct information
@@ -99,7 +99,7 @@ public void TagIO_RW_VQF_Empty()
9999
Assert.AreEqual("This is a test", theFile.NativeTag.Comment);
100100
Assert.AreEqual(2008, theFile.NativeTag.Date.Year);
101101
Assert.AreEqual("FPS", theFile.NativeTag.Genre);
102-
Assert.AreEqual(22, theFile.NativeTag.TrackNumber);
102+
Assert.AreEqual("22", theFile.NativeTag.TrackNumber);
103103

104104

105105
// Setting a standard field using additional fields shouldn't be possible
@@ -277,7 +277,7 @@ private void readExistingTagsOnFile(AudioDataManager theFile, string testCopyrig
277277
Assert.AreEqual("Rock", theFile.NativeTag.Genre);
278278
Assert.AreEqual("this is a comment", theFile.NativeTag.Comment);
279279
Assert.AreEqual(2016, theFile.NativeTag.Date.Year);
280-
Assert.AreEqual(22, theFile.NativeTag.TrackNumber);
280+
Assert.AreEqual("22", theFile.NativeTag.TrackNumber);
281281
Assert.AreEqual(testCopyright, theFile.NativeTag.Copyright);
282282

283283
// Unsupported field (GERR)

ATL.unit-test/IO/MetaData/Vorbis_FLAC.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public void TagIO_RW_VorbisFLAC_Empty()
196196
theTag.Comment = "This is a test";
197197
theTag.Date = DateTime.Parse("2008/01/01");
198198
theTag.Genre = "Merengue";
199-
theTag.TrackNumber = 1;
199+
theTag.TrackNumber = "1";
200200
theTag.TrackTotal = 1;
201201
theTag.DiscNumber = 2;
202202
theTag.Popularity = 2.5f / 5;
@@ -220,7 +220,7 @@ public void TagIO_RW_VorbisFLAC_Empty()
220220
Assert.AreEqual("This is a test", theFile.NativeTag.Comment);
221221
Assert.AreEqual(2008, theFile.NativeTag.Date.Year);
222222
Assert.AreEqual("Merengue", theFile.NativeTag.Genre);
223-
Assert.AreEqual(1, theFile.NativeTag.TrackNumber);
223+
Assert.AreEqual("1", theFile.NativeTag.TrackNumber);
224224
Assert.AreEqual(2, theFile.NativeTag.DiscNumber);
225225
Assert.AreEqual((float)(2.5 / 5), theFile.NativeTag.Popularity);
226226
Assert.AreEqual("Me", theFile.NativeTag.Composer);

ATL.unit-test/IO/MetaData/Vorbis_OGG.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public void TagIO_RW_VorbisOGG_Empty(Stream stream)
275275
theTag.Comment = "This is a test";
276276
theTag.Date = DateTime.Parse("2008/01/01"); // <-- TODO : this field is _not_ valued when passing through Track + beware of alternate formattings depending on the format
277277
theTag.Genre = "Merengue";
278-
theTag.TrackNumber = 1;
278+
theTag.TrackNumber = "1";
279279
theTag.TrackTotal = 2;
280280
theTag.DiscNumber = 3;
281281
theTag.DiscTotal = 4;
@@ -299,7 +299,7 @@ public void TagIO_RW_VorbisOGG_Empty(Stream stream)
299299
Assert.AreEqual("This is a test", theFile.NativeTag.Comment);
300300
Assert.AreEqual(2008, theFile.NativeTag.Date.Year);
301301
Assert.AreEqual("Merengue", theFile.NativeTag.Genre);
302-
Assert.AreEqual(1, theFile.NativeTag.TrackNumber);
302+
Assert.AreEqual("1", theFile.NativeTag.TrackNumber);
303303
Assert.AreEqual(2, theFile.NativeTag.TrackTotal);
304304
Assert.AreEqual(3, theFile.NativeTag.DiscNumber);
305305
Assert.AreEqual(4, theFile.NativeTag.DiscTotal);

ATL.unit-test/IO/MetaData/WAV.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void initListInfoTestData()
6868
Genre = "info.IGNR",
6969
Comment = "info.ICMT",
7070
Date = DateTime.Parse("2018-01-09T01:23:45"),
71-
TrackNumber = 5,
71+
TrackNumber = "5",
7272
Popularity = 0.2f,
7373
EncodedBy = "info.ITCH",
7474
Encoder = "info.ISFT",

ATL.unit-test/IO/MetaData/WMA.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void TagIO_RW_WMA_Empty()
106106
theTag.Comment = "This is a test";
107107
theTag.Date = DateTime.Parse("2008/01/01");
108108
theTag.Genre = "Merengue";
109-
theTag.TrackNumber = 1;
109+
theTag.TrackNumber = "1";
110110
theTag.TrackTotal = 1;
111111
theTag.DiscNumber = 2;
112112
theTag.Composer = "Me";
@@ -130,7 +130,7 @@ public void TagIO_RW_WMA_Empty()
130130
Assert.AreEqual("This is a test", theFile.NativeTag.Comment);
131131
Assert.AreEqual(2008, theFile.NativeTag.Date.Year);
132132
Assert.AreEqual("Merengue", theFile.NativeTag.Genre);
133-
Assert.AreEqual(1, theFile.NativeTag.TrackNumber);
133+
Assert.AreEqual("1", theFile.NativeTag.TrackNumber);
134134
Assert.AreEqual(2, theFile.NativeTag.DiscNumber);
135135
Assert.AreEqual((float)(2.0 / 5), theFile.NativeTag.Popularity);
136136
Assert.AreEqual("Me", theFile.NativeTag.Composer);
@@ -213,7 +213,7 @@ public void TagIO_RW_WMA_Empty_NonWM()
213213
theTag.Comment = "This is a test";
214214
theTag.Date = DateTime.Parse("2008/01/01");
215215
theTag.Genre = "Merengue";
216-
theTag.TrackNumber = 1;
216+
theTag.TrackNumber = "1";
217217
theTag.TrackTotal = 1;
218218
theTag.DiscNumber = 2;
219219
theTag.Composer = "Me";
@@ -236,7 +236,7 @@ public void TagIO_RW_WMA_Empty_NonWM()
236236
Assert.AreEqual("This is a test", theFile.NativeTag.Comment);
237237
Assert.AreEqual(2008, theFile.NativeTag.Date.Year);
238238
Assert.AreEqual("Merengue", theFile.NativeTag.Genre);
239-
Assert.AreEqual(1, theFile.NativeTag.TrackNumber);
239+
Assert.AreEqual("1", theFile.NativeTag.TrackNumber);
240240
Assert.AreEqual(2, theFile.NativeTag.DiscNumber);
241241
Assert.AreEqual("Me", theFile.NativeTag.Composer);
242242
Assert.AreEqual("父", theFile.NativeTag.Copyright);

ATL.unit-test/Misc/TrackUtilsTest.cs

+29
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,35 @@ public void TrackUtils_ExtractTrackNumber()
3131
Assert.AreEqual(0, TrackUtils.ExtractTrackNumber("99999999"));
3232
}
3333

34+
[TestMethod]
35+
public void TrackUtils_ExtractTrackNumberStr()
36+
{
37+
Assert.AreEqual("1", TrackUtils.ExtractTrackNumberStr("1"));
38+
Assert.AreEqual("01", TrackUtils.ExtractTrackNumberStr("01"));
39+
Assert.AreEqual("15", TrackUtils.ExtractTrackNumberStr("15"));
40+
Assert.AreEqual("15", TrackUtils.ExtractTrackNumberStr(" 15"));
41+
Assert.AreEqual("15", TrackUtils.ExtractTrackNumberStr(" 15 "));
42+
Assert.AreEqual("15", TrackUtils.ExtractTrackNumberStr("15 "));
43+
Assert.AreEqual("15.1", TrackUtils.ExtractTrackNumberStr("15.1"));
44+
Assert.AreEqual("15,1", TrackUtils.ExtractTrackNumberStr("15,1"));
45+
Assert.AreEqual("a15a", TrackUtils.ExtractTrackNumberStr("a15a"));
46+
47+
Assert.AreEqual("1", TrackUtils.ExtractTrackNumberStr("1/16"));
48+
Assert.AreEqual("01", TrackUtils.ExtractTrackNumberStr("01/16"));
49+
Assert.AreEqual("15", TrackUtils.ExtractTrackNumberStr("15/16"));
50+
Assert.AreEqual("15", TrackUtils.ExtractTrackNumberStr(" 15 / 16"));
51+
Assert.AreEqual("15", TrackUtils.ExtractTrackNumberStr(" 15//16"));
52+
53+
Assert.AreEqual("A1", TrackUtils.ExtractTrackNumberStr(" A1"));
54+
Assert.AreEqual("A1", TrackUtils.ExtractTrackNumberStr("A1"));
55+
Assert.AreEqual("A1", TrackUtils.ExtractTrackNumberStr(" A1 "));
56+
Assert.AreEqual("aaa", TrackUtils.ExtractTrackNumberStr("aaa"));
57+
58+
Assert.AreEqual("", TrackUtils.ExtractTrackNumberStr(""));
59+
Assert.AreEqual("", TrackUtils.ExtractTrackNumberStr(null));
60+
Assert.AreEqual("99999999", TrackUtils.ExtractTrackNumberStr("99999999"));
61+
}
62+
3463
[TestMethod]
3564
public void TrackUtils_ExtractTrackTotal()
3665
{

ATL/AudioData/AudioFileIO.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Threading.Tasks;
99
using static ATL.AudioData.MetaDataIOFactory;
1010
using static ATL.LyricsInfo;
11+
using Commons;
1112

1213
namespace ATL.AudioData
1314
{
@@ -90,7 +91,7 @@ private IMetaDataIO getAndCheckMetadata()
9091
LogDelegator.GetLogDelegate()(Log.LV_WARNING, "Could not find any metadata");
9192

9293
// Consistency checks
93-
if (result.TrackTotal > 0 && result.TrackNumber > result.TrackTotal)
94+
if (result.TrackTotal > 0 && Utils.IsNumeric(result.TrackNumber) && Utils.ParseFirstIntegerPart(result.TrackNumber) > result.TrackTotal)
9495
LogDelegator.GetLogDelegate()(Log.LV_INFO, "Track number (" + result.TrackNumber + ") is > total tracks (" + result.TrackTotal + ")");
9596

9697
if (result.DiscTotal > 0 && result.DiscNumber > result.DiscTotal)

ATL/AudioData/CrossMetadataReader.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,17 @@ public string Genre
133133
}
134134
}
135135
/// <inheritdoc/>
136-
public ushort TrackNumber
136+
public string TrackNumber
137137
{
138138
get
139139
{
140-
ushort track = 0;
140+
string value = "";
141141
foreach (IMetaDataIO reader in metaReaders)
142142
{
143-
track = reader.TrackNumber;
144-
if (track != 0) break;
143+
value = reader.TrackNumber;
144+
if (value != null && value != "") break;
145145
}
146-
return track;
146+
return value;
147147
}
148148
}
149149
/// <inheritdoc/>

ATL/AudioData/IO/Helpers/ListTag.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ public static bool IsDataEligible(MetaDataHolder meta)
132132
if (meta.Genre.Length > 0) return true;
133133
if (meta.Date > DateTime.MinValue) return true;
134134
if (meta.Copyright.Length > 0) return true;
135-
if (meta.TrackNumber > 0) return true;
136135
if (meta.Popularity > 0) return true;
137136
if (meta.EncodedBy.Length > 0) return true;
138137
if (meta.Encoder.Length > 0) return true;
@@ -210,9 +209,9 @@ private static void writeInfoPurpose(BinaryWriter w, MetaDataHolder meta, MetaDa
210209
if (value.Length > 0) writeSizeAndNullTerminatedString("IRTD", value, w, writtenFields);
211210
}
212211
// Track number
213-
if (meta.TrackNumber > 0)
212+
if (meta.TrackNumber != null && meta.TrackNumber != "")
214213
{
215-
value = meta.TrackNumber.ToString();
214+
value = meta.TrackNumber;
216215
if (0 == value.Length && additionalFields.TryGetValue("info.TRCK", out var additionalField3)) value = additionalField3;
217216
if (0 == value.Length && additionalFields.TryGetValue("info.IPRT", out var field4)) value = field4;
218217
if (0 == value.Length && additionalFields.TryGetValue("info.ITRK", out var additionalField4)) value = additionalField4;

ATL/AudioData/IO/ID3v1.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ protected override int write(TagData tag, Stream s, string zone)
372372

373373
// ID3v1.1 standard
374374
s.WriteByte(0);
375-
s.WriteByte((byte)Math.Min(TrackUtils.ExtractTrackNumber(tag[Field.TRACK_NUMBER]), Byte.MaxValue));
375+
s.WriteByte((byte)Math.Min(TrackUtils.ExtractTrackNumber(tag[Field.TRACK_NUMBER]), byte.MaxValue));
376376

377377
byte genre = byte.MaxValue;
378378
if (tag[Field.GENRE] != null)

ATL/AudioData/Interfaces/IMetaData.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ string Genre
5353
}
5454
/// <summary>
5555
/// Track number
56+
/// NB1 : Stored in string for to alow storing LP tracks (e.g. A1, A2...)
57+
/// NB2 : Does not include total notation (e.g. 01/12); only the track number itself
5658
/// </summary>
57-
ushort TrackNumber
59+
string TrackNumber
5860
{
5961
get;
6062
}

0 commit comments

Comments
 (0)