Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from MM:SS to HH:MM:SS duration representation if needed. #1049

Merged
merged 3 commits into from
Feb 17, 2023

Conversation

ThomasFrans
Copy link
Contributor

This PR applies the same logic to durations as the native Spotify client:
0:00
0:01
0:23
0:20
1:00
10:02
1:00:00
1:01:01
...

It applies it to all the places where currently the old method was used (statusbar left and right, track durations, episode durations).

closes #1048

Copy link
Owner

@hrkfdn hrkfdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks, looks good to me. Just have a minor question.

src/utils.rs Outdated
Comment on lines 36 to 40
if hours > 0 {
formated_time.push_str(&format!("{hours}:"));
}
if hours > 0 {
formated_time.push_str(&format!("{minutes:02}:"));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this block be merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oops. I was thinking in terms of the steps that had to be applied (hours, minutes, seconds) to get to the representation. Didn't consider moving those together. 😄

@ThomasFrans
Copy link
Contributor Author

No one saw a thing leaves in shame

@hrkfdn hrkfdn merged commit a3c4989 into hrkfdn:main Feb 17, 2023
@hrkfdn
Copy link
Owner

hrkfdn commented Feb 17, 2023

Merged, thanks again ❤️

@ThomasFrans ThomasFrans deleted the improve-time-display branch February 19, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show track duration as hours:minutes:seconds when appropriate
2 participants