Add optional "localtimezone;" prefix for the recording directory (#497)#3832
Open
mcfnord wants to merge 1 commit into
Open
Add optional "localtimezone;" prefix for the recording directory (#497)#3832mcfnord wants to merge 1 commit into
mcfnord wants to merge 1 commit into
Conversation
…ussoftware#497) Implements the design agreed in issue jamulussoftware#497: prefixing the recording directory with "localtimezone;" (e.g. -R "localtimezone;/path/to/recordings") names recording session folders using local time instead of UTC, so they line up with the server log's local-time entries. Without the prefix, behaviour is unchanged (UTC remains the default). The prefix is parsed in CJamController::SetRecordingDir, the common path for the -R argument, the server GUI and JSON-RPC. The stored directory string keeps the prefix so it round-trips through the ini file and getRecorderStatus unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Note
📡 STAND BY FOR AN LLM-AUTHORED MESSAGE.
Fixes #497.
This implements the design that was agreed in the issue thread in 2021 and — unusually — consolidated into the issue body itself as a buildable spec, at @gilgongo's request, by the reporter @victorypoint: an opt-in
localtimezone;prefix on the existing recording-directory argument, using the;separator format @corrados proposed for consistency with other combined command-line values.With the prefix, recording session folders are named using local time, so they match the server log's own (local-time) timestamps without manual UTC-offset math. Without it, nothing changes: UTC remains the default, preserving the property discussed in the thread that folder names on multi-timezone public servers stay unambiguous unless the operator explicitly opts in.
How it works:
CJamController::SetRecordingDir— the single chokepoint shared by all three ways of setting the directory (-R/ini, the server GUI, and JSON-RPCjamulusserver/setRecordingDirectory), so it behaves identically everywhere.getRecorderStatus, and the GUI — a server started once with the prefix keeps the behaviour across restarts.boolis threaded throughCJamRecordertoCJamSession, which picksQDateTime::currentDateTime()vscurrentDateTimeUtc()for the session folder name. The folder-name format (Jam-yyyyMMdd-HHmmsszzz) is unchanged.--helptext anddocs/JSON-RPC.md(regenerated withtools/generate_json_rpc_docs.py) are updated.Deliberately not included: the issue body's secondary wish to also switch the folder-name format to ISO (
yyyy-MM-dd HH:mm:ss). That would change the format for every existing server and any tooling that parses it; the agreed compromise was the opt-in prefix, so this PR does only that.Testing (Linux, Qt 5): built clean; functional test ran a headless server with
TZ=America/Los_Angelesand a headless client to trigger a session, twice: with-R "localtimezone;<dir>"the session folder carried the local (UTC−7) timestamp matching the server log line; with a plain-R <dir>it carried the UTC timestamp, byte-identical behaviour to before. A prefix-only value ("localtimezone;"with no path) degrades to the existing "recording not initialised" path.