Commit ba9b544c authored by Felix Paul Kühne's avatar Felix Paul Kühne

album track: fix comparing disc numbers and tracks without numbers

parent 5880c4df
Version 2.6.1
-------------
* Fixed file lookup for paths containing spaces or umlauts
* Fixed music album import issues
Version 2.6.0
-------------
......
......@@ -94,18 +94,20 @@ NSString *const MLAlbumTrackDiscNumber = @"MLAlbumTrackDiscNumber";
NSSet *tracks = [album tracks];
MLAlbumTrack *track = nil;
if (trackNumber) {
for (MLAlbumTrack *trackIter in tracks) {
if ([trackIter.trackNumber intValue] == [trackNumber intValue]) {
if (trackIter.discNumber == discNumber)
track = trackIter;
for (MLAlbumTrack *trackIter in tracks) {
if ([trackIter.trackNumber intValue] == [trackNumber intValue]) {
if (trackIter.discNumber.intValue == discNumber.intValue) {
track = trackIter;
break;
} else if ([trackIter.title isEqualToString:trackName]) {
}
} else if ([trackIter.title isEqualToString:trackName]) {
if (trackIter.discNumber.intValue == discNumber.intValue) {
track = trackIter;
break;
}
}
}
if (!track && createIfNeeded) {
track = [[MLMediaLibrary sharedMediaLibrary] createObjectForEntity:@"AlbumTrack"];
if (trackNumber.integerValue == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment