Commit 969af122 authored by Tobias's avatar Tobias Committed by Felix Paul Kühne

add additional options for readonly mode

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent ef00bcf8
......@@ -33,6 +33,7 @@
@property (nonatomic, copy) NSString *libraryBasePath;
@property (nonatomic, strong) NSURL *persistentStoreURL;
@property (nonatomic, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property (nonatomic, copy) NSDictionary *additionalPersitentStoreOptions;
+ (id)sharedMediaLibrary;
......
......@@ -201,6 +201,11 @@ static NSString *kDecrapifyTitles = @"MLDecrapifyTitles";
NSNumber *yes = @YES;
NSDictionary *options = @{NSMigratePersistentStoresAutomaticallyOption : yes,
NSInferMappingModelAutomaticallyOption : yes};
if (self.additionalPersitentStoreOptions.count > 0) {
NSMutableDictionary *mutableOptions = options.mutableCopy;
[mutableOptions addEntriesFromDictionary:self.additionalPersitentStoreOptions];
options = mutableOptions;
}
NSError *error;
NSPersistentStore *persistentStore = [coordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:self.persistentStoreURL options:options error:&error];
......
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