From ae0661ad7842d3d93c1edfb313a5ba44956de5c9 Mon Sep 17 00:00:00 2001 From: postscriptum Date: Tue, 1 Jul 2025 22:37:05 +0300 Subject: [PATCH] add comments, dump attachment copy event --- src/nex.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nex.rs b/src/nex.rs index 7abf431..99c4db6 100644 --- a/src/nex.rs +++ b/src/nex.rs @@ -84,6 +84,8 @@ impl Nex { match source { Source::Url(url) => url, Source::File(from) => { + // attachments directory starts with dot in this implementation + // it is usually hidden but accessible in the servers like Nexy let d = format!(".{}", published.format(&self.filename)); let mut to = PathBuf::from(&p); to.push(&d); @@ -92,12 +94,16 @@ impl Nex { .file_name() .unwrap() .to_string_lossy() - .replace("post-", ""); + .replace("post-", ""); // cleanup extras from readable txt to.push(&f); if !to.exists() { fs::copy(&from, &to).unwrap(); + println!( + "\t\t\tcopy attachment file `{}`", + to.to_string_lossy() + ) } - format!("{d}/{f}") + format!("{d}/{f}") // relative URI } } ));