Skip to content

Commit ecad34a

Browse files
committed
fixup: formatTVShowStringForSpecialEpisode
1 parent 3b3ae13 commit ecad34a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

XBMC Remote/DetailViewController.m

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

48354835
// 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)