From 76ba5669fd187799097f6f763d14638e2c04f441 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 17 Feb 2025 13:40:01 +0100 Subject: gate alt-title --- import/src/lib.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'import/src/lib.rs') diff --git a/import/src/lib.rs b/import/src/lib.rs index 3b9a690..293ffb0 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -416,16 +416,17 @@ fn import_media_file( NodeKind::Video }; node.title = Some(infojson.title); - node.subtitle = infojson - .alt_title - .or(infojson - .uploader - .as_ref() - .map(|u| clean_uploader_name(u).to_owned())) - .or(node.subtitle.clone()); - if node.title == node.subtitle { - node.subtitle = None + node.subtitle = if infojson.alt_title != node.title { + infojson.alt_title + } else { + None } + .or(infojson + .uploader + .as_ref() + .map(|u| clean_uploader_name(u).to_owned())) + .or(node.subtitle.clone()); + if let Some(desc) = infojson.description { node.description = Some(desc) } -- cgit v1.2.3-70-g09d2