Commit 189ab605 authored by Tobias's avatar Tobias Committed by Felix Paul Kühne

add new model version and migration model

MLAlbumTrack:
+ containsArtwork
MLFile:
+ thumbnailName

add unread property in model implemented in the class but not added to the model
Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 861b8b86
......@@ -40,6 +40,7 @@
@property (nonatomic, strong) MLAlbum *album;
@property (nonatomic, strong) NSSet *files;
@property (nonatomic) BOOL containsArtwork;
@end
......
......@@ -76,6 +76,7 @@ extern NSString *kMLFileTypeAudio;
@property (nonatomic, strong) NSNumber *folderTrackNumber;
@property (nonatomic, strong) NSString *genre;
@property (nonatomic, strong) MLAlbumTrack *albumTrack;
@property (nonatomic, strong) NSString *thumbnailName;
@property (nonatomic, strong) UIImage *computedThumbnail;
@property (nonatomic, assign) BOOL isSafe;
......
This diff is collapsed.
......@@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>MediaLibrary-2.5.xcdatamodel</string>
<string>MediaLibrary-2.5.2.xcdatamodel</string>
</dict>
</plist>
......@@ -48,6 +48,7 @@
A792468D170F09A30036AAF2 /* MLShowEpisode.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 7D0EF515170885130003ED47 /* MLShowEpisode.h */; };
A792468E170F09A30036AAF2 /* MLThumbnailerQueue.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 7D0EF521170885130003ED47 /* MLThumbnailerQueue.h */; };
DDB959371AFB9B2B00BB8CFF /* MLMediaLibrary+Migration.m in Sources */ = {isa = PBXBuildFile; fileRef = DDB959361AFB9B2B00BB8CFF /* MLMediaLibrary+Migration.m */; };
DDB959391AFBAD8700BB8CFF /* MappingModel_2_5_to_2_5_2.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = DDB959381AFBAD8700BB8CFF /* MappingModel_2_5_to_2_5_2.xcmappingmodel */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -139,8 +140,10 @@
7D9E238417AEEA13008485E5 /* MLAlbumTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MLAlbumTrack.h; sourceTree = "<group>"; };
7D9E238517AEEA13008485E5 /* MLAlbumTrack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLAlbumTrack.m; sourceTree = "<group>"; };
7D9E238717AEEA71008485E5 /* MLAlbum.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MLAlbum.m; sourceTree = "<group>"; };
DD8EE4891AF908820067954E /* MediaLibrary-2.5.2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MediaLibrary-2.5.2.xcdatamodel"; sourceTree = "<group>"; };
DDB959351AFB9B2B00BB8CFF /* MLMediaLibrary+Migration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MLMediaLibrary+Migration.h"; sourceTree = "<group>"; };
DDB959361AFB9B2B00BB8CFF /* MLMediaLibrary+Migration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MLMediaLibrary+Migration.m"; sourceTree = "<group>"; };
DDB959381AFBAD8700BB8CFF /* MappingModel_2_5_to_2_5_2.xcmappingmodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcmappingmodel; path = MappingModel_2_5_to_2_5_2.xcmappingmodel; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -158,6 +161,7 @@
7D0EF495170883940003ED47 = {
isa = PBXGroup;
children = (
DDB959381AFBAD8700BB8CFF /* MappingModel_2_5_to_2_5_2.xcmappingmodel */,
7D4625821A560729001A80B4 /* MediaLibrary.xcdatamodeld */,
7D0EF536170885230003ED47 /* TouchXML */,
7D0EF506170885130003ED47 /* Headers */,
......@@ -377,6 +381,7 @@
7D0EF52D170885130003ED47 /* MLMovieInfoGrabber.m in Sources */,
7D0EF52E170885130003ED47 /* MLShow.m in Sources */,
7D0EF52F170885130003ED47 /* MLShowEpisode.m in Sources */,
DDB959391AFBAD8700BB8CFF /* MappingModel_2_5_to_2_5_2.xcmappingmodel in Sources */,
7D0EF530170885130003ED47 /* MLThumbnailerQueue.m in Sources */,
7D0EF531170885130003ED47 /* MLTitleDecrapifier.m in Sources */,
7D0EF532170885130003ED47 /* MLTVShowEpisodesInfoGrabber.m in Sources */,
......@@ -541,10 +546,11 @@
7D4625821A560729001A80B4 /* MediaLibrary.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
DD8EE4891AF908820067954E /* MediaLibrary-2.5.2.xcdatamodel */,
7D4625831A560729001A80B4 /* MediaLibrary-2.1.xcdatamodel */,
7D4625841A560729001A80B4 /* MediaLibrary-2.5.xcdatamodel */,
);
currentVersion = 7D4625841A560729001A80B4 /* MediaLibrary-2.5.xcdatamodel */;
currentVersion = DD8EE4891AF908820067954E /* MediaLibrary-2.5.2.xcdatamodel */;
path = MediaLibrary.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
......
......@@ -106,4 +106,5 @@
@dynamic trackNumber;
@dynamic album;
@dynamic files;
@dynamic containsArtwork;
@end
......@@ -44,6 +44,12 @@ NSString *kMLFileTypeAudio = @"audio";
return [NSString stringWithFormat:@"<MLFile title='%@'>", [self title]];
}
- (void)awakeFromInsert
{
[super awakeFromInsert];
self.thumbnailName = [NSUUID UUID].UUIDString;
}
+ (NSArray *)allFiles
{
NSFetchRequest *request = [[NSFetchRequest alloc] init];
......@@ -204,6 +210,7 @@ NSString *kMLFileTypeAudio = @"audio";
@dynamic genre;
@dynamic albumTrack;
@dynamic unread;
@dynamic thumbnailName;
- (NSNumber *)lastPosition
{
......@@ -269,8 +276,8 @@ NSString *kMLFileTypeAudio = @"audio";
{
MLMediaLibrary *sharedLibrary = [MLMediaLibrary sharedMediaLibrary];
NSString *folder = [sharedLibrary thumbnailFolderPath];
NSURL *url = [[self objectID] URIRepresentation];
return [[folder stringByAppendingPathComponent:[url path]] stringByAppendingString:@".png"];
NSString *thumbnailFullName = [[self thumbnailName] stringByAppendingPathExtension:@"png"];
return [folder stringByAppendingPathComponent:thumbnailFullName];
}
- (UIImage *)computedThumbnail
......
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