app: find a clip in the folder it was recorded to

History lists a timeline from the default recordings folder, where
the daemon writes them, but review looked for its clip only there as
well. A recording made into the folder chosen in settings therefore
appeared in history with no video. The app now searches the
configured folder first and the default one after it, and uses the
path stored with the timeline when the recorder wrote one, so a clip
stays playable after the setting moves and an older timeline still
plays.

Settings are read back after a save because the daemon resolves the
chosen folder to an absolute path. The two Open folder buttons open
the configured folder instead of the default one.
This commit is contained in:
vhaudiquet committed 2026-11-23 18:24:22 +01:00
1 parent 86fc7cea2f
commit 9e4349fe42
5 files changed
+167 -34

No files matched your search

+36 -7
View File
@@ -473,6 +473,35 @@ impl App {
self.processes_rx = Some(rx);
}
/// Where the daemon writes new recordings, as the settings it holds say.
///
/// The draft stands in until the daemon has answered, so a first launch points at the
/// default folder the daemon would use anyway.
pub fn output_dir(&self) -> PathBuf {
let path = self
.settings
.as_ref()
.map(|settings| settings.output.path.as_str())
.unwrap_or(self.form.draft.output.path.as_str());
if path.is_empty() {
crate::daemon::recordings_dir()
} else {
PathBuf::from(path)
}
}
/// The folders a recording's clip may be in: the configured output folder first, then the
/// default one, where timelines and the clips folder live.
pub fn video_roots(&self) -> Vec<PathBuf> {
let default = crate::daemon::recordings_dir();
let output = self.output_dir();
if output == default {
vec![output]
} else {
vec![output, default]
}
}
/// List the timelines on disk and read the first page of rows on a thread of their own.
/// `poll` picks them up.
pub fn refresh_games(&mut self) {
@@ -700,14 +729,15 @@ impl App {
Err(e) => self.notify_error(e),
}
}
// The daemon answers a save with `{"success": true}`; the draft is already what
// it holds, so there is nothing to read back.
// The daemon answers a save with `{"success": true}`. Read the settings back:
// it may have resolved the recordings folder to an absolute path.
(ipc::Request::SaveSettings, Ok(_)) => {
self.settings = Some(self.form.settings());
self.form.saving = false;
self.form.dirty = false;
self.form.loaded = true;
self.notify("Settings saved");
self.daemon.get_settings();
}
(ipc::Request::SaveSettings, Err(e)) => {
self.form.saving = false;
@@ -966,12 +996,11 @@ pub fn poll(app: &mut App, t: f64, tx: &mut Tx) -> bool {
if let Some(at) = std::env::var("LR_DEMO_PAUSE_AT")
.ok()
.and_then(|v| v.parse::<f64>().ok())
&& let Some(player) = &app.review.player
&& player.is_playing()
&& player.time() >= at
{
if let Some(player) = &app.review.player {
if player.is_playing() && player.time() >= at {
app.review.playback();
}
}
app.review.playback();
}
app.handle_poll(t, tx)
}