Repository navigation
fix(web): show 1 min instead of 60 secs on video thumbnails - #3565
Open
AryaKesharwani wants to merge 1 commit into
Open
AryaKesharwani wants to merge 1 commit into
AryaKesharwani wants to merge 1 commit into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Video cards showed "60 secs" for recordings between 59 and 60 seconds, because
formatDurationfloored minutes but rounded the leftover seconds up withMath.ceil, so they could reach 60 without rolling over.Round the duration up to whole seconds once, before splitting it into hours/minutes/seconds. Short clips still never read "0 secs", and the seconds can no longer exceed 59.
1 sec1 sec59 secs59 secs60 secs1 min1 min1 min59 mins1 hr2 mins/2 hrsThe only other change is at unit boundaries: a fractional second just under a whole minute or hour now rounds into it (e.g. 3599.5 s →
1 hr), matching the existing round-up of seconds.formatDurationis exported so it can be unit-tested; no other code changes.Validation: new
video-thumbnail-duration.test.ts(4 tests) passes; the minute and hour rollover cases fail against the previous logic. Existingdate-format.test.tsstill passes. Verified in a local self-hosted web build: a seeded 59.5 s Cap showed60 secson My Caps before the change and1 minafter, next to 59.0 s (59 secs) and 60.0 s (1 min). Biome check passes on both touched files.Closes #3563.


Confidence Score: 5/5
This PR appears safe to merge.Summary
Fixes video thumbnail labels by rounding up to whole seconds before choosing hours, minutes, or seconds.
Reviews (1) · Last reviewed commit: "fix(web): show 1 min instead of 60 secs ..." · Reviewed by Greptile