Skip to content

Commit

Permalink
fixup: back to int
Browse files Browse the repository at this point in the history
  • Loading branch information
wutschel committed May 11, 2024
1 parent 36f801c commit 3305873
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions XBMC Remote/NowPlaying.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
BOOL shuffled;
NSString *repeatStatus;
BOOL updateProgressBar;
long totalSeconds;
int totalSeconds;
NSString *lastThumbnail;
int choosedTab;
NSString *notificationName;
Expand All @@ -101,7 +101,7 @@
int lastPlayerID;
long lastSelected;
int currentPlayerID;
long storePosSeconds;
int storePosSeconds;
long storedItemID;
MessagesView *messagesView;
}
Expand Down
20 changes: 10 additions & 10 deletions XBMC Remote/NowPlaying.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ - (UIImage*)resizeToolbarThumb:(UIImage*)img {

#pragma mark - utility

- (long)getSecondsFromTimeDict:(NSDictionary*)timeDict {
long hours = [timeDict[@"hours"] intValue];
long minutes = [timeDict[@"minutes"] intValue];
long seconds = [timeDict[@"seconds"] intValue];
- (int)getSecondsFromTimeDict:(NSDictionary*)timeDict {
int hours = [timeDict[@"hours"] intValue];
int minutes = [timeDict[@"minutes"] intValue];
int seconds = [timeDict[@"seconds"] intValue];
return ((hours * 60) + minutes) * 60 + seconds;
}

Expand Down Expand Up @@ -764,7 +764,7 @@ - (void)getActivePlayers {
}

// Detect start of new song to update party mode playlist
long posSeconds = [self getSecondsFromTimeDict:actualTimeDict];
int posSeconds = [self getSecondsFromTimeDict:actualTimeDict];
if (musicPartyMode && posSeconds < storePosSeconds) {
[self checkPartyMode];
}
Expand Down Expand Up @@ -1794,11 +1794,11 @@ - (IBAction)startUpdateProgressBar:(id)sender {

- (IBAction)updateCurrentTime:(id)sender {
if (!updateProgressBar && !nothingIsPlaying) {
long selectedTimeInSeconds = (long)((ProgressSlider.value / 100) * totalSeconds);
long hours = selectedTimeInSeconds / 3600;
long minutes = (selectedTimeInSeconds / 60) % 60;
long seconds = selectedTimeInSeconds % 60;
NSString *selectedTime = HMS_TO_STRING((int)hours, (int)minutes, (int)seconds);
int selectedTimeInSeconds = (int)((ProgressSlider.value / 100) * totalSeconds);
int hours = selectedTimeInSeconds / 3600;
int minutes = (selectedTimeInSeconds / 60) % 60;
int seconds = selectedTimeInSeconds % 60;
NSString *selectedTime = HMS_TO_STRING(hours, minutes, seconds);
currentTime.text = selectedTime;
scrabbingRate.text = LOCALIZED_STR(([NSString stringWithFormat:@"Scrubbing %@", @(ProgressSlider.scrubbingSpeed)]));
}
Expand Down

0 comments on commit 3305873

Please sign in to comment.