Skip to content

Use the clip filename template for session recordings - #307

Draft
milan483 wants to merge 1 commit into
splitshotz:mainfrom
milan483:milan/session-name-template
Draft

milan483 wants to merge 1 commit into
splitshotz:mainfrom
milan483:milan/session-name-template

Conversation

@milan483

@milan483 milan483 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Session recordings now follow the same filename template as clips. Clip and session filename supports $n, $date, $time, and $game for both, with a shared numbering sequence.

Leaving the template empty keeps the existing clip and session defaults. Unusable templates fall back to those defaults, and existing recordings are never overwritten. Custom-named sessions keep their session metadata and start-time game identity.

Testing

  • On KDE Plasma Wayland, automated recorder tests saved one replay clip and five sessions, covering shared numbering, default naming, unusable templates, and filename collisions. All six videos decoded fully. These tests used the recorder directly; the desktop UI was not tested.
  • All 57 focused tests passed. Full discovery on Python 3.14 ran 1,048 tests: 1,042 passed, four skipped, and two failed. The two failures, involving AV1 selection and default Chromium flags, also reproduced on clean upstream at the branch's base commit.
  • Locale checks and the UI build passed. All six upstream CI checks passed, including Python 3.10, 3.12, and 3.13 tests, Arch packaging, Nix, and the Flatpak build.

@splitshotz splitshotz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks, the change itself is small and tidy, and CI is green. I found a way it can lose a recording, so it can't go in as it is.

  1. A clip save can swallow a session file. _gsr_replay_candidates tells Vice's own files from a fresh replay only by the Vice_Clip_ and Vice_Session_ prefixes. With a template, a session file created while a clip save is waiting for its replay looks like the replay, gets renamed to a clip name and is trimmed to the clip length. I reproduced it with the real GSRRecorder.save_clip and the template rec_$n: an 8 second session rec_1.mp4 came back as a 2 second rec_2.mp4, and rec_1.mp4 was gone. The window is usually a fraction of a second, but it's 20 seconds when the recorder is slow to flush. Please leave the recorder's own session path out of the candidates instead of relying on a prefix.

  2. A clip and a session can be given the same name. _next_session_path returns a name, but the file only exists once the capture process creates it, and a clip renamed in that gap gets the same path. With rec_$n both came back as rec_1.mp4, and with clip_$date_$time both got the same minute. Please reserve the name when it's handed out (create it with O_EXCL, or keep a set of reserved names that the clip naming also checks).

  3. French, German, Indonesian and Portuguese still say "Clip filename" and "clip number" for the two strings you changed. They have their own text, so there's no fallback to English. Those need the old keys removed or updated.

One thing I still have to decide: this renames sessions for everyone who already set a template, and with something like clip_$date_$time a session can no longer be told from a clip by its name. I may want it as its own switch. I'll answer here once 1 and 2 are fixed.

@milan483
milan483 marked this pull request as draft November 18, 2026 00:24
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.

2 participants