Commit 8b1454b3 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Library: correctly remove thumbnails when files disappear

parent ff386534
...@@ -95,6 +95,10 @@ extern NSString *kMLFileTypeAudio; ...@@ -95,6 +95,10 @@ extern NSString *kMLFileTypeAudio;
*/ */
- (void)didHide; - (void)didHide;
/**
* do not rely on this path unless you are a MLKit object */
- (NSString *)thumbnailPath;
/** /**
* Shortcuts to the videoTracks. * Shortcuts to the videoTracks.
*/ */
......
...@@ -815,7 +815,7 @@ static NSString *kDecrapifyTitles = @"MLDecrapifyTitles"; ...@@ -815,7 +815,7 @@ static NSString *kDecrapifyTitles = @"MLDecrapifyTitles";
[show removeEpisode:file.showEpisode]; [show removeEpisode:file.showEpisode];
} }
#if TARGET_OS_IPHONE #if TARGET_OS_IPHONE
NSString *thumbPath = [[[self thumbnailFolderPath] stringByAppendingPathComponent:[[file.objectID URIRepresentation] path]] stringByAppendingString:@".png"]; NSString *thumbPath = [file thumbnailPath];
bool thumbExists = [fileManager fileExistsAtPath:thumbPath]; bool thumbExists = [fileManager fileExistsAtPath:thumbPath];
if (thumbExists) if (thumbExists)
[fileManager removeItemAtPath:thumbPath error:nil]; [fileManager removeItemAtPath:thumbPath 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