Commit 92f0e4ee authored by Felix Paul Kühne's avatar Felix Paul Kühne

MLFile: broadcast a notification when the thumbnail was updated

parent e5dce5cf
......@@ -35,6 +35,8 @@ extern NSString *kMLFileTypeClip;
extern NSString *kMLFileTypeTVShowEpisode;
extern NSString *kMLFileTypeAudio;
extern NSString *const MLFileThumbnailWasUpdated;
@interface MLFile : NSManagedObject
+ (NSArray *)allFiles;
......
......@@ -38,6 +38,7 @@ NSString *kMLFileTypeMovie = @"movie";
NSString *kMLFileTypeClip = @"clip";
NSString *kMLFileTypeTVShowEpisode = @"tvShowEpisode";
NSString *kMLFileTypeAudio = @"audio";
NSString *const MLFileThumbnailWasUpdated = @"MLFileThumbnailWasUpdated";
@implementation MLFile
......@@ -319,6 +320,9 @@ NSString *kMLFileTypeAudio = @"audio";
[UIImageJPEGRepresentation(image, .9) writeToURL:url atomically:YES];
else
[UIImagePNGRepresentation(image) writeToURL:url atomically:YES];
[[NSNotificationCenter defaultCenter] postNotificationName:MLFileThumbnailWasUpdated
object:self];
}
- (BOOL)isSafe
......
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