Save the maps in the preferences.

This commit is contained in:
Damiano Galassi committed 2016-07-28 21:03:22 +02:00
1 parent 058aef0212
commit c15d67c819
9 files changed
+376 -204

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
//
// SBMetadataDefaultSet.h
// Subler
//
// Created by Damiano Galassi on 28/07/2016.
//
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SBMetadataResultMapItem : NSObject<NSSecureCoding>
+ (instancetype)itemWithKey:(NSString *)key value:(NSArray *)value;
- (instancetype)initWithKey:(NSString *)key value:(NSArray *)value;
@property (nonatomic, readonly) NSString *key;
@property (nonatomic, readwrite, copy) NSArray<NSString *> *value;
@end
typedef NS_ENUM(NSUInteger, SBMetadataResultMapType) {
SBMetadataResultMapTypeMovie,
SBMetadataResultMapTypeTvShow,
};
/**
* Maps the values returned by the metadata importers
* the the MP42Metadata values.
*/
@interface SBMetadataResultMap : NSObject<NSSecureCoding>
+ (NSArray<NSString *> *)movieKeys;
+ (instancetype)movieDefaultMap;
+ (NSArray<NSString *> *)tvShowKeys;
+ (instancetype)tvShowDefaultMap;
- (instancetype)initWithItems:(NSArray<SBMetadataResultMapItem *> *)items type:(SBMetadataResultMapType)type;
@property (nonatomic, readonly) NSMutableArray<SBMetadataResultMapItem *> *items;
@property (nonatomic, readonly) SBMetadataResultMapType type;
@end
@interface NSUserDefaults (SublerMetadataResultMapAdditions)
- (nullable SBMetadataResultMap *)SB_resultMapForKey:(NSString *)defaultName;
- (void)SB_setResultMap:(nullable SBMetadataResultMap *)value forKey:(NSString *)defaultName;
@end
NS_ASSUME_NONNULL_END