From 29f874e3902c8eb676546e6807a8e88010b5786b Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 14 Sep 2023 18:00:41 +0200 Subject: [PATCH] Fix font detections when there is none --- transcoder/src/identify.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/transcoder/src/identify.rs b/transcoder/src/identify.rs index b6a454f0..9cbc3779 100644 --- a/transcoder/src/identify.rs +++ b/transcoder/src/identify.rs @@ -225,10 +225,13 @@ pub async fn identify(path: String) -> Result { .collect(), subtitles: subs, fonts: general["extra"]["Attachments"] - .to_string() - .split(" / ") - .map(|x| format!("/video/{sha}/attachment/{x}")) - .collect(), + .as_str() + .map_or(Vec::new(), |x| { + x.to_string() + .split(" / ") + .map(|x| format!("/video/{sha}/attachment/{x}")) + .collect() + }), chapters: output["media"]["track"] .members() .find(|x| x["@type"] == "Menu")