diff options
author | metamuffin <metamuffin@disroot.org> | 2025-02-17 13:40:01 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-02-17 13:40:01 +0100 |
commit | 76ba5669fd187799097f6f763d14638e2c04f441 (patch) | |
tree | 513c3e31f22819d99f2909697c1eca9295f78311 /import | |
parent | 1c75a8ecd1aebce4e39a00cde897d02550774d1c (diff) | |
download | jellything-76ba5669fd187799097f6f763d14638e2c04f441.tar jellything-76ba5669fd187799097f6f763d14638e2c04f441.tar.bz2 jellything-76ba5669fd187799097f6f763d14638e2c04f441.tar.zst |
gate alt-title
Diffstat (limited to 'import')
-rw-r--r-- | import/src/lib.rs | 19 |
1 files changed, 10 insertions, 9 deletions
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) } |