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

Implement user defaults setting to disable file name decrapification

parent b2af1102
......@@ -3,6 +3,8 @@ Next Version
- fixed subitem behavior of MLShow and MLAlbum on removal
- MLTitleDecrapifier handles shows with more than 99 and less than 1000
episodes correctly now
- added user defaults option to disable file name display optimizations
when media is newly added to the library
Added Public APIs:
- MLShow:
......
......@@ -46,6 +46,7 @@
// Pref key
static NSString *kLastTVDBUpdateServerTime = @"MLLastTVDBUpdateServerTime";
static NSString *kUpdatedToTheGreatSharkHuntDatabaseFormat = @"upgradedToDatabaseFormat 2.3";
static NSString *kDecrapifyTitles = @"MLDecrapifyTitles";
#if HAVE_BLOCK
@interface MLMediaLibrary ()
......@@ -59,7 +60,8 @@ static NSString *kUpdatedToTheGreatSharkHuntDatabaseFormat = @"upgradedToDatabas
@implementation MLMediaLibrary
+ (void)initialize
{
[[NSUserDefaults standardUserDefaults] registerDefaults:@{kUpdatedToTheGreatSharkHuntDatabaseFormat : [NSNumber numberWithBool:NO]}];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults registerDefaults:@{kUpdatedToTheGreatSharkHuntDatabaseFormat : [NSNumber numberWithBool:NO], kDecrapifyTitles : [NSNumber numberWithBool:YES]}];
}
+ (id)sharedMediaLibrary
......@@ -602,7 +604,10 @@ static NSString *kUpdatedToTheGreatSharkHuntDatabaseFormat = @"upgradedToDatabas
}
#endif
file.title = [MLTitleDecrapifier decrapify:[title stringByDeletingPathExtension]];
if ([[[NSUserDefaults standardUserDefaults] objectForKey:kDecrapifyTitles] boolValue] == YES)
file.title = [MLTitleDecrapifier decrapify:[title stringByDeletingPathExtension]];
else
file.title = [title stringByDeletingPathExtension];
if ([size longLongValue] < 150000000) /* 150 MB */
file.type = kMLFileTypeClip;
......
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