diff --git a/crates/engine/src/smart.rs b/crates/engine/src/smart.rs index b607d84d82..3628f188ce 100644 --- a/crates/engine/src/smart.rs +++ b/crates/engine/src/smart.rs @@ -202,9 +202,11 @@ pub fn migrate(from: &Path, to: &Path, what: Existing) -> (usize, Vec) { } for src in files(from) { let Some(name) = src.file_name() else { continue }; - let dst = name.to_str().and_then(|n| n.strip_suffix(".lcsp")).filter(|stem| { - stem.len() == 32 && stem.bytes().all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase()) - }).map_or_else(|| to.join(name), |stem| to.join(&stem[..2]).join(name)); + let dst = name + .to_str() + .and_then(|n| n.strip_suffix(".lcsp")) + .filter(|stem| stem.len() == 32 && stem.bytes().all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase())) + .map_or_else(|| to.join(name), |stem| to.join(&stem[..2]).join(name)); let r = match what { Existing::Discard => std::fs::remove_file(&src), _ => { diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rs index 5bd4f98d0a..501a78c5e9 100644 --- a/crates/ui-egui/src/panels/right.rs +++ b/crates/ui-egui/src/panels/right.rs @@ -694,16 +694,11 @@ fn info(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) { if let lightcraft_catalog::Source::File { path } = &p.source { let avail = &app.session.media.availability; let online = !avail.is_offline(path); - let smart = app - .session - .media - .smart_dir - .as_ref() - .is_some_and(|d| { - let shard = lightcraft_engine::smart::sharded_file_path(d, &p); - let legacy = d.join(lightcraft_engine::smart::file_name(&p)); - avail.exists(&shard.to_string_lossy()) == Some(true) || avail.exists(&legacy.to_string_lossy()) == Some(true) - }); + let smart = app.session.media.smart_dir.as_ref().is_some_and(|d| { + let shard = lightcraft_engine::smart::sharded_file_path(d, &p); + let legacy = d.join(lightcraft_engine::smart::file_name(&p)); + avail.exists(&shard.to_string_lossy()) == Some(true) || avail.exists(&legacy.to_string_lossy()) == Some(true) + }); if !online || smart { let text = match (online, smart) { (false, true) => "Original offline ยท editing the smart preview",