Skip to content

best way to save what you love

api/create-filename: don't assign any of potentially blank tags

wukkoe768e7f6faee
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);