Commit f2025d68 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

playlist: correctly delete collection objects

(cherry picked from commit bff2b0ec)
parent cae75e74
......@@ -320,6 +320,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
for (MLFile *file in iterFiles)
[self _deleteMediaObject:file];
}
[[MLMediaLibrary sharedMediaLibrary] removeObject: album];
// delete all episodes from a show
} else if ([managedObject isKindOfClass:[MLShow class]]) {
MLShow *show = managedObject;
......@@ -331,6 +332,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
for (MLFile *file in iterFiles)
[self _deleteMediaObject:file];
}
[[MLMediaLibrary sharedMediaLibrary] removeObject: show];
// delete all files from an episode
} else if ([managedObject isKindOfClass:[MLShowEpisode class]]) {
MLShowEpisode *episode = managedObject;
......@@ -339,6 +341,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
for (MLFile *file in iterFiles)
[self _deleteMediaObject:file];
// delete all files from a track
[[MLMediaLibrary sharedMediaLibrary] removeObject: episode];
} else if ([managedObject isKindOfClass:[MLAlbumTrack class]]) {
MLAlbumTrack *track = managedObject;
NSSet *iterFiles = [NSSet setWithSet:track.files];
......@@ -1000,11 +1003,13 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
NSNumber *folderTrackNumber = [NSNumber numberWithInt:(int)[label files].count - 1];
file.folderTrackNumber = folderTrackNumber;
id item;
@synchronized(self) {
[_foundMedia removeObjectAtIndex:folderIndex];
[_foundMedia insertObject:label atIndex:folderIndex];
item = _foundMedia[((NSIndexPath *)_indexPaths[0]).item];
}
id item = _foundMedia[((NSIndexPath *)_indexPaths[0]).item];
if (![item isKindOfClass:[MLFile class]])
return;
......
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