Commit 314c8376 authored by Felix Paul Kühne's avatar Felix Paul Kühne

title decrapifier: be less aggressive against encoding groups in file names,...

title decrapifier: be less aggressive against encoding groups in file names, since otherwise, we loose single word episode names
parent 9c6382eb
......@@ -140,17 +140,10 @@ static inline NSNumber *numberFromThreeChars(char high, char mid, char low)
episode = numberFromTwoChars(c(str,i+4), c(str,i+5));
NSString *tvShowName = i > 0 ? [str substringToIndex:i] : nil;
tvShowName = tvShowName ? [[MLTitleDecrapifier decrapify:tvShowName] capitalizedString] : nil;
NSString *episodeName = stringLength > i + 4 ? [str substringFromIndex:i+6] : nil;
NSArray *components = [episodeName componentsSeparatedByString:@" "];
NSUInteger componentsCount = components.count;
NSString *episodeName = stringLength > i + 4 ? [str substringFromIndex:i+6] : nil;
episodeName = episodeName ? [MLTitleDecrapifier decrapify:episodeName] : nil;
/* episode name is optional */
if ([episodeName isEqualToString:components[componentsCount - 1]])
episodeName = nil;
mutableDict = [[NSMutableDictionary alloc] initWithCapacity:4];
if (season)
[mutableDict setObject:season forKey:@"season"];
......@@ -178,16 +171,8 @@ static inline NSNumber *numberFromThreeChars(char high, char mid, char low)
tvShowName = tvShowName ? [[MLTitleDecrapifier decrapify:tvShowName] capitalizedString] : nil;
NSString *episodeName = stringLength > i + 4 ? [str substringFromIndex:i+4] : nil;
NSArray *components = [episodeName componentsSeparatedByString:@" "];
NSUInteger componentsCount = components.count;
episodeName = episodeName ? [MLTitleDecrapifier decrapify:episodeName] : nil;
/* episode name is optional */
if ([episodeName isEqualToString:components[componentsCount - 1]])
episodeName = nil;
mutableDict = [[NSMutableDictionary alloc] initWithCapacity:3];
if (season)
[mutableDict setObject:season forKey:@"season"];
......
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