From 84bd38f36baf373501b029ffbbaa5381b7e26aa0 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 13 Dec 2023 17:06:38 +0100 Subject: import: ignore metadata --- tool/src/import/mod.rs | 7 +++++++ tool/src/main.rs | 3 +++ 2 files changed, 10 insertions(+) (limited to 'tool/src') diff --git a/tool/src/import/mod.rs b/tool/src/import/mod.rs index ec88fdd..250643e 100644 --- a/tool/src/import/mod.rs +++ b/tool/src/import/mod.rs @@ -35,6 +35,7 @@ pub(crate) fn import(action: Action, dry: bool) -> anyhow::Result<()> { ignore_attachments, copy, video, + ignore_metadata, r#move, } => { if std::env::current_dir().unwrap().file_name().unwrap() != "library" { @@ -98,6 +99,12 @@ pub(crate) fn import(action: Action, dry: bool) -> anyhow::Result<()> { file_meta.cover = None; file_meta.infojson = None; } + if ignore_metadata { + let file_meta = file_meta.as_mut().unwrap(); + file_meta.description = None; + file_meta.tagline = None; + file_meta.title = None; + } if let Some(ij) = &file_meta.as_ref().unwrap().infojson { infojson = diff --git a/tool/src/main.rs b/tool/src/main.rs index 8135d20..26865c6 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -67,6 +67,9 @@ enum Action { /// Ignore attachments (dont use them as cover) #[arg(long)] ignore_attachments: bool, + /// Ignore metadate (no title, description and tagline from input) + #[arg(long)] + ignore_metadata: bool, }, Migrate { database: PathBuf, -- cgit v1.2.3-70-g09d2