Commit a526241e authored by Felix Paul Kühne's avatar Felix Paul Kühne

media library: add documentFolderPath symbol

parent 9103b7e7
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* MobileMediaLibraryKit * MobileMediaLibraryKit
***************************************************************************** *****************************************************************************
* Copyright (C) 2010 Pierre d'Herbemont * Copyright (C) 2010 Pierre d'Herbemont
* Copyright (C) 2010-2013 VLC authors and VideoLAN * Copyright (C) 2010-2014 VLC authors and VideoLAN
* $Id$ * $Id$
* *
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org> * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
...@@ -25,12 +25,7 @@ ...@@ -25,12 +25,7 @@
#import <CoreData/CoreData.h> #import <CoreData/CoreData.h>
@interface MLMediaLibrary : NSObject { @interface MLMediaLibrary : NSObject
NSManagedObjectContext *_managedObjectContext;
NSManagedObjectModel *_managedObjectModel;
BOOL _allowNetworkAccess;
}
@property (readonly) BOOL libraryNeedsUpgrade; @property (readonly) BOOL libraryNeedsUpgrade;
@property (nonatomic, strong) id delegate; @property (nonatomic, strong) id delegate;
...@@ -46,6 +41,7 @@ ...@@ -46,6 +41,7 @@
- (id)createObjectForEntity:(NSString *)entity; - (id)createObjectForEntity:(NSString *)entity;
- (void)removeObject:(NSManagedObject *)object; - (void)removeObject:(NSManagedObject *)object;
- (NSString *)thumbnailFolderPath; - (NSString *)thumbnailFolderPath;
- (NSString *)documentFolderPath;
- (void)applicationWillStart; - (void)applicationWillStart;
- (void)applicationWillExit; - (void)applicationWillExit;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* MobileMediaLibraryKit * MobileMediaLibraryKit
***************************************************************************** *****************************************************************************
* Copyright (C) 2010 Pierre d'Herbemont * Copyright (C) 2010 Pierre d'Herbemont
* Copyright (C) 2010-2013 VLC authors and VideoLAN * Copyright (C) 2010-2014 VLC authors and VideoLAN
* $Id$ * $Id$
* *
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org> * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
...@@ -41,8 +41,14 @@ ...@@ -41,8 +41,14 @@
@interface MLMediaLibrary () @interface MLMediaLibrary ()
{ {
NSManagedObjectContext *_managedObjectContext;
NSManagedObjectModel *_managedObjectModel;
BOOL _allowNetworkAccess;
NSString *_thumbnailFolderPath; NSString *_thumbnailFolderPath;
NSString *_databaseFolderPath; NSString *_databaseFolderPath;
NSString *_documentFolderPath;
} }
@end @end
...@@ -154,6 +160,20 @@ static NSString *kDecrapifyTitles = @"MLDecrapifyTitles"; ...@@ -154,6 +160,20 @@ static NSString *kDecrapifyTitles = @"MLDecrapifyTitles";
return _thumbnailFolderPath; return _thumbnailFolderPath;
} }
- (NSString *)documentFolderPath
{
if (_documentFolderPath) {
if (_documentFolderPath.length > 0)
return _documentFolderPath;
}
int directory = NSDocumentDirectory;
NSArray *paths = NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES);
NSURL *url = [NSURL fileURLWithPath:paths[0]];
_documentFolderPath = [url absoluteString];
return _documentFolderPath;
}
- (NSManagedObjectContext *)managedObjectContext - (NSManagedObjectContext *)managedObjectContext
{ {
if (_managedObjectContext) if (_managedObjectContext)
......
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