Repository navigation
forms: Show session durations of a minute and longer - #15
Merged
Merged
Conversation
The Session Duration column of the settings dialog's session table is formatted by FormatSessionDuration() (forms/SessionDuration.h), so it can be tested on its own. No change in behaviour: it still uses QTime(0, 0, seconds). Refs obs-rust/obs-studio#1116. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Session Duration column of the session table in Tools > WebSocket Server Settings counted 00:00:00 to 00:00:59 and then stayed empty for the rest of the session. QTime(0, 0, s) is only valid for s from 0 to 59, and an invalid QTime turns into an empty string. FormatSessionDuration() now builds hh:mm:ss from the seconds count itself; the hours count on past 24 instead of wrapping (QTime::addSecs() would wrap), and a negative count (clock set back) shows 00:00:00. Reported upstream in obsproject/obs-websocket#1208 by bryce-seifert. DanielLester83 found the QTime range limit in obsproject/obs-websocket#1179. Refs obs-rust/obs-studio#1116. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 6 tasks
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.
The Session Duration column of the session table in Tools > WebSocket Server Settings counts 00:00:00 to 00:00:59 and then stays empty for the rest of the session, while the client is still connected and its message counts keep going up (upstream obsproject/obs-websocket#1208, reported by bryce-seifert; gitagogaming saw it too).
SettingsDialog::FillSessionTable()(src/forms/SettingsDialog.cppline 252) formatted the duration withQTime(0, 0, sessionDuration).toString("hh:mm:ss").QTime(h, m, s)only takessfrom 0 to 59, so from one minute on the QTime is invalid andtoString()returns an empty string. DanielLester83 found this Qt limit in obsproject/obs-websocket#1179 (closed); that patch did not build (currentSecsSinceEpoch()returns a number, which has noaddSecs()) and computed minutes as/ 360, so this is a new fix.Two commits:
forms: Move the session duration text into a helper:FormatSessionDuration()in the new headersrc/forms/SessionDuration.h, unchanged behaviour (stillQTime(0, 0, seconds)), so it can be tested on its own.forms: Show session durations of a minute and longer: the helper buildshh:mm:ssfrom the seconds count. The hours count on past 24 (QTime(0, 0).addSecs()would wrap to 00 after a day), and a negative count (the clock set back below the connect time) shows 00:00:00.Tested in obs-rust/obs-studio with
test_ws_session_duration, which builds the header with Qt Core only: 4 of 5 cases fail at the helper-only commit (one minute and more, hours, more than a day, clock set back) and 5 of 5 pass with the fix, in both libobs lanes. Also in a full OBS build (frontend + obs-websocket) in both lanes, and end to end: with one client connected, the release v0.1.0-beta.20261014 shows 00:00:32 at 30 s and an empty cell at 70 s; builds with this branch show 00:00:31 and 00:01:12 (C libobs lane) and 00:00:32 and 00:01:12 (Rust libobs lane).Refs obs-rust/obs-studio#1116. The obs-rust/obs-studio PR that moves the submodule to this branch carries the regression test and closes the issue.
🤖 Generated with Claude Code