record-daemon: give scripted runs a home of their own

An end-to-end run of mine put its settings through updateSettings, which
wrote them to the user's real config: output path in %TEMP%, a "probe"
application, 30 fps. The next game recorded into %TEMP%, so it showed up
in the history with its metadata and no video beside it.

RECORD_DAEMON_HOME now moves the config directory, the recordings, the
logs and the IPC pipe under one directory. The app reads the same
variable, so a probe talks to the scratch daemon instead of the real one.
Default paths are unchanged.

The daemon also logs its config and recordings paths at startup, which is
the first thing to look at when a recording has no video.
This commit is contained in:
vhaudiquet committed 2026-11-17 00:19:13 +01:00
1 parent 6584b2f92f
commit 2e463dab3a
6 files changed
+71 -8

No files matched your search

+6
View File
@@ -8,8 +8,14 @@ use std::time::Duration;
use crate::ipc::Client;
/// Set this to point the app and the daemon at a scratch directory, as scripts do.
pub const HOME_ENV: &str = "RECORD_DAEMON_HOME";
/// The daemon's data directory, shared with the daemon itself.
pub fn data_dir() -> Option<PathBuf> {
if let Some(home) = std::env::var_os(HOME_ENV).filter(|value| !value.is_empty()) {
return Some(PathBuf::from(home).join("data"));
}
directories::ProjectDirs::from("com", "leaguerecorder", "record-daemon")
.map(|dirs| dirs.data_dir().to_path_buf())
}