From e768e7f6faeea1c3638b3af0b83dc01b076432f4 Mon Sep 17 00:00:00 2001 From: wukko Date: Thu, 12 Sep 2024 14:35:42 +0600 Subject: [PATCH] api/create-filename: don't assign any of potentially blank tags --- api/src/processing/create-filename.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/api/src/processing/create-filename.js b/api/src/processing/create-filename.js index 4f248377..216b15a4 100644 --- a/api/src/processing/create-filename.js +++ b/api/src/processing/create-filename.js @@ -2,11 +2,19 @@ export default (f, style, isAudioOnly, isAudioMuted) => { let filename = ''; let infoBase = [f.service, f.id]; - let classicTags = [...infoBase, f.resolution]; - let basicTags = [f.qualityLabel]; + let classicTags = [...infoBase]; + let basicTags = []; const title = `${f.title} - ${f.author}`; + if (f.resolution) { + classicTags.push(f.resolution); + } + + if (f.qualityLabel) { + basicTags.push(f.qualityLabel); + } + if (f.youtubeFormat) { classicTags.push(f.youtubeFormat); basicTags.push(f.youtubeFormat);