Ensure CDRWin indexes are sorted.

This commit is contained in:
2021-09-24 20:47:23 +01:00
parent afee8399cd
commit 4a9986e37f
2 changed files with 5 additions and 5 deletions

View File

@@ -121,7 +121,7 @@ namespace Aaru.DiscImages
var currentTrack = new CdrWinTrack
{
Indexes = new Dictionary<ushort, int>()
Indexes = new SortedDictionary<ushort, int>()
};
var currentFile = new CdrWinTrackFile();
@@ -798,7 +798,7 @@ namespace Aaru.DiscImages
currentTrack = new CdrWinTrack
{
Indexes = new Dictionary<ushort, int>(),
Indexes = new SortedDictionary<ushort, int>(),
Sequence = uint.Parse(matchTrack.Groups[1].Value)
};
@@ -1262,7 +1262,7 @@ namespace Aaru.DiscImages
currentFilePath = track.TrackFile.DataFilter.GetBasePath();
}
Dictionary<ushort, int> newIndexes = new Dictionary<ushort, int>();
SortedDictionary<ushort, int> newIndexes = new SortedDictionary<ushort, int>();
foreach(KeyValuePair<ushort, int> index in track.Indexes)
newIndexes[index.Key] = index.Value + currentFileStartSector;
@@ -2268,4 +2268,4 @@ namespace Aaru.DiscImages
public List<Track> GetSessionTracks(ushort session) =>
Tracks.Where(t => t.TrackSession == session).OrderBy(t => t.TrackSequence).ToList();
}
}
}

View File

@@ -72,7 +72,7 @@ namespace Aaru.DiscImages
/// <summary>Track genre (from CD-Text)</summary>
public string Genre;
/// <summary>Indexes on this track</summary>
public Dictionary<ushort, int> Indexes;
public SortedDictionary<ushort, int> Indexes;
/// <summary>Track ISRC</summary>
public string Isrc;
/// <summary>Track performer (from CD-Text)</summary>