Commit 36d5b35b authored by Carola Nitz's avatar Carola Nitz Committed by Felix Paul Kühne

added conveniencemethods to get an mlfile from albums and episodes

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 32c1b6e2
...@@ -30,6 +30,8 @@ extern NSString *const MLAlbumTrackNumber; ...@@ -30,6 +30,8 @@ extern NSString *const MLAlbumTrackNumber;
extern NSString *const MLAlbumTrackTrackName; extern NSString *const MLAlbumTrackTrackName;
extern NSString *const MLAlbumTrackDiscNumber; extern NSString *const MLAlbumTrackDiscNumber;
@class MLFile;
@interface MLAlbumTrack : NSManagedObject @interface MLAlbumTrack : NSManagedObject
+ (NSArray *)allTracks; + (NSArray *)allTracks;
...@@ -79,4 +81,5 @@ extern NSString *const MLAlbumTrackDiscNumber; ...@@ -79,4 +81,5 @@ extern NSString *const MLAlbumTrackDiscNumber;
- (void)removeFilesObject:(NSManagedObject *)value; - (void)removeFilesObject:(NSManagedObject *)value;
- (void)addFiles:(NSSet *)value; - (void)addFiles:(NSSet *)value;
- (void)removeFiles:(NSSet *)value; - (void)removeFiles:(NSSet *)value;
- (MLFile *)anyFileFromTrack;
@end @end
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#import <CoreData/CoreData.h> #import <CoreData/CoreData.h>
@class MLShow; @class MLShow;
@class MLFile;
@interface MLShowEpisode : NSManagedObject @interface MLShowEpisode : NSManagedObject
...@@ -56,6 +57,6 @@ ...@@ -56,6 +57,6 @@
- (void)removeFilesObject:(NSManagedObject *)value; - (void)removeFilesObject:(NSManagedObject *)value;
- (void)addFiles:(NSSet *)value; - (void)addFiles:(NSSet *)value;
- (void)removeFiles:(NSSet *)value; - (void)removeFiles:(NSSet *)value;
- (MLFile *)anyFileFromEpisode;
@end @end
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#import "MLMediaLibrary.h" #import "MLMediaLibrary.h"
#import "MLAlbumTrack.h" #import "MLAlbumTrack.h"
#import "MLAlbum.h" #import "MLAlbum.h"
#import "MLFile.h"
NSString *const MLAlbumTrackAlbum = @"MLAlbumTrackAlbum"; NSString *const MLAlbumTrackAlbum = @"MLAlbumTrackAlbum";
NSString *const MLAlbumTrackAlbumName = @"MLAlbumTrackAlbumName"; NSString *const MLAlbumTrackAlbumName = @"MLAlbumTrackAlbumName";
...@@ -183,4 +184,10 @@ NSString *const MLAlbumTrackDiscNumber = @"MLAlbumTrackDiscNumber"; ...@@ -183,4 +184,10 @@ NSString *const MLAlbumTrackDiscNumber = @"MLAlbumTrackDiscNumber";
@dynamic album; @dynamic album;
@dynamic files; @dynamic files;
@dynamic containsArtwork; @dynamic containsArtwork;
- (MLFile *)anyFileFromTrack
{
return (MLFile *)self.files.anyObject;
}
@end @end
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#import "MLMediaLibrary.h" #import "MLMediaLibrary.h"
#import "MLShowEpisode.h" #import "MLShowEpisode.h"
#import "MLShow.h" #import "MLShow.h"
#import "MLFile.h"
@interface MLShowEpisode () @interface MLShowEpisode ()
@property (nonatomic, strong) NSNumber *primitiveUnread; @property (nonatomic, strong) NSNumber *primitiveUnread;
...@@ -139,4 +140,10 @@ ...@@ -139,4 +140,10 @@
@dynamic name; @dynamic name;
@dynamic show; @dynamic show;
@dynamic files; @dynamic files;
- (MLFile *)anyFileFromTrack
{
return (MLFile *)self.files.anyObject;
}
@end @end
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