From d7cb6607d1859a74a1565e007ace7c6894c7d6de Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Sun, 26 Jan 2025 14:59:14 -0800 Subject: Add edit/reset option --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 4a89183..5c56c93 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,6 +68,9 @@ struct EditArgs { /// True if the entry should not be published. #[arg(long)] hidden: Option, + /// Reset the metadata to match the file. + #[arg(long)] + reset: bool, } #[derive(clap::Args, Debug)] @@ -110,6 +113,10 @@ async fn main() -> Result<(), Box> { } async fn update_entry(feed: &mut MP32RSS, args: EditArgs) -> Result<(), Box> { + if args.reset { + let new_entry = feed.access().fetch_entry(args.filename.clone()).await?; + feed.insert_entry(new_entry); + } if let Some(entry) = feed.get_mut_entry(&args.filename) { if let Some(v) = args.title { entry.title = Some(v); -- cgit v1.2.3