mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-19 02:10:25 -05:00
Batch 30: cargo fmt over the merged PRs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BKWB9TCnvzJHV6xMLAj2J4
This commit is contained in:
2 files changed
+10
-13
No files matched your search
@@ -202,9 +202,11 @@ pub fn migrate(from: &Path, to: &Path, what: Existing) -> (usize, Vec<String>) {
|
||||
}
|
||||
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),
|
||||
_ => {
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user