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

playlist: make sure to stop playback before deleting a given media from the library

parent 1d69074f
......@@ -379,6 +379,16 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
if (inFolder)
[self rearrangeFolderTrackNumbersForRemovedItem:mediaObject];
/* stop playback if needed */
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
if (vpc.isPlaying) {
MLFile *currentlyPlayingFile = [[MLFile fileForURL:vpc.mediaPlayer.media.url] firstObject];
if (currentlyPlayingFile) {
if (currentlyPlayingFile == mediaObject)
[vpc stopPlayback];
}
}
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *folderLocation = [[mediaObject.url path] stringByDeletingLastPathComponent];
NSArray *allfiles = [fileManager contentsOfDirectoryAtPath:folderLocation error:nil];
......
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