Skip to content

Commit 0072413

Browse files
committed
fixup: formatTVShowStringForSpecialEpisode
1 parent 1927168 commit 0072413

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

XBMC Remote/DetailViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4830,7 +4830,7 @@ - (void)retrieveData:(NSString*)methodToCall parameters:(NSDictionary*)parameter
48304830
BOOL isTVShowSpecial = [newDict[@"season"] integerValue] == 0;
48314831
newDict[@"isTVShowSpecial"] = @(isTVShowSpecial);
48324832
if (isTVShowSpecial) {
4833-
newDict[@"specialEpisode"] = [NSString stringWithFormat:@"S%i", [item[@"episode"] intValue]];
4833+
newDict[@"specialEpisode"] = [Utilities formatTVShowStringForSpecialEpisode:item[@"episode"]];
48344834
}
48354835

48364836
// In case "specialsort" is valid, add an item copy with according season/episode.

XBMC Remote/Utilities.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ typedef NS_ENUM(NSInteger, LogoBackgroundType) {
111111
+ (void)imageView:(UIImageView*)view AnimDuration:(NSTimeInterval)seconds Image:(UIImage*)image;
112112
+ (float)getPercentElapsed:(NSDate*)startDate EndDate:(NSDate*)endDate;
113113
+ (void)createTransparentToolbar:(UIToolbar*)toolbar;
114+
+ (NSString*)formatTVShowStringForSpecialEpisode:(id)episode;
114115
+ (NSString*)formatTVShowStringForSeasonTrailing:(id)season episode:(id)episode title:(NSString*)title;
115116
+ (NSString*)formatTVShowStringForSeasonLeading:(id)season episode:(id)episode title:(NSString*)title;
116117
+ (NSString*)formatTVShowStringForSeason:(id)season episode:(id)episode;

XBMC Remote/Utilities.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,10 @@ + (void)createTransparentToolbar:(UIToolbar*)toolbar {
12571257
forToolbarPosition:UIBarPositionAny];
12581258
}
12591259

1260+
+ (NSString*)formatTVShowStringForSpecialEpisode:(id)episode {
1261+
return [NSString stringWithFormat:@"S%i", [episode intValue]];
1262+
}
1263+
12601264
+ (NSString*)formatTVShowStringForSeasonLeading:(id)season episode:(id)episode title:(NSString*)title {
12611265
NSString *seasonAndEpisode = [Utilities formatTVShowStringForSeason:season episode:episode];
12621266
NSString *text = [NSString stringWithFormat:@"%@%@%@", seasonAndEpisode, seasonAndEpisode.length ? @" " : @"", title];
@@ -1278,8 +1282,7 @@ + (NSString*)formatTVShowStringForSeason:(id)season episode:(id)episode {
12781282
text = [NSString stringWithFormat:format, [season intValue], [episode intValue]];
12791283
}
12801284
else if (![season intValue] && [episode intValue]) {
1281-
// Special episode
1282-
text = [NSString stringWithFormat:@"S%i", [episode intValue]];
1285+
text = [self formatTVShowStringForSpecialEpisode:episode];
12831286
}
12841287
}
12851288
return text;

0 commit comments

Comments
 (0)