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

Upgrade ObjC syntax

parent ab92bc51
......@@ -124,7 +124,7 @@
MLAlbum *album = nil;
BOOL wasCreated = NO;
MLAlbumTrack *track = [MLAlbumTrack trackWithAlbumName:albumName trackNumber:[NSNumber numberWithInteger:[trackNumber integerValue]] createIfNeeded:YES wasCreated:&wasCreated];
MLAlbumTrack *track = [MLAlbumTrack trackWithAlbumName:albumName trackNumber:@([trackNumber integerValue]) createIfNeeded:YES wasCreated:&wasCreated];
if (track) {
album = track.album;
track.title = title ? title : @"";
......
......@@ -61,7 +61,7 @@ static NSString *kDecrapifyTitles = @"MLDecrapifyTitles";
+ (void)initialize
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults registerDefaults:@{kUpdatedToTheGreatSharkHuntDatabaseFormat : [NSNumber numberWithBool:NO], kDecrapifyTitles : [NSNumber numberWithBool:YES]}];
[defaults registerDefaults:@{kUpdatedToTheGreatSharkHuntDatabaseFormat : @NO, kDecrapifyTitles : @YES}];
}
+ (id)sharedMediaLibrary
......
......@@ -99,7 +99,7 @@
[[NSSortDescriptor alloc] initWithKey:@"episodeNumber"
ascending:YES
selector:@selector(compare:)];
NSArray *descriptors = [NSArray arrayWithObjects:seasonDescriptor, episodesDescriptor, nil];
NSArray *descriptors = @[seasonDescriptor, episodesDescriptor];
return [[episodes sortedArrayUsingDescriptors:descriptors] retain];
}
......
......@@ -146,13 +146,13 @@ static inline NSNumber *numberFromThreeChars(char high, char mid, char low)
mutableDict = [[NSMutableDictionary alloc] initWithCapacity:4];
if (season)
[mutableDict setObject:season forKey:@"season"];
mutableDict[@"season"] = season;
if (episode)
[mutableDict setObject:episode forKey:@"episode"];
mutableDict[@"episode"] = episode;
if (tvShowName && ![tvShowName isEqualToString:@" "])
[mutableDict setObject:tvShowName forKey:@"tvShowName"];
mutableDict[@"tvShowName"] = tvShowName;
if (episodeName.length > 0 && ![episodeName isEqualToString:@" "])
[mutableDict setObject:[episodeName capitalizedString] forKey:@"tvEpisodeName"];
mutableDict[@"tvEpisodeName"] = [episodeName capitalizedString];
successfulSearch = YES;
}
}
......@@ -165,7 +165,7 @@ static inline NSNumber *numberFromThreeChars(char high, char mid, char low)
isDigit(c(str, i+2)) &&
isDigit(c(str, i+3)))
{
NSNumber *season = [NSNumber numberWithInt:intFromChar(c(str,i))];
NSNumber *season = @(intFromChar(c(str,i)));
NSNumber *episode = numberFromTwoChars(c(str,i+2), c(str,i+3));
NSString *tvShowName = i > 0 ? [str substringToIndex:i] : NSLocalizedString(@"UNTITLED_SHOW", @"");
tvShowName = tvShowName ? [[MLTitleDecrapifier decrapify:tvShowName] capitalizedString] : nil;
......@@ -175,13 +175,13 @@ static inline NSNumber *numberFromThreeChars(char high, char mid, char low)
mutableDict = [[NSMutableDictionary alloc] initWithCapacity:3];
if (season)
[mutableDict setObject:season forKey:@"season"];
mutableDict[@"season"] = season;
if (episode)
[mutableDict setObject:episode forKey:@"episode"];
mutableDict[@"episode"] = episode;
if (tvShowName && ![tvShowName isEqualToString:@" "])
[mutableDict setObject:tvShowName forKey:@"tvShowName"];
mutableDict[@"tvShowName"] = tvShowName;
if (episodeName.length > 0 && ![episodeName isEqualToString:@" "])
[mutableDict setObject:[episodeName capitalizedString] forKey:@"tvEpisodeName"];
mutableDict[@"tvEpisodeName"] = [episodeName capitalizedString];
successfulSearch = YES;
}
}
......@@ -209,7 +209,7 @@ static inline NSNumber *numberFromThreeChars(char high, char mid, char low)
} else
title = [self decrapify:title];
return [NSDictionary dictionaryWithObject:title forKey:VLCMetaInformationTitle];
return @{VLCMetaInformationTitle: title};
}
@end
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