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

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

parent a3ec51a9
......@@ -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] 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