From 64d9f29209e87df374016e350a8f4b5f60480a11 Mon Sep 17 00:00:00 2001 From: Snazzah Date: Sun, 16 Jun 2024 19:24:26 -0500 Subject: [PATCH] fix(threads): small fix to quality selection --- src/modules/processing/services/threads.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/processing/services/threads.js b/src/modules/processing/services/threads.js index 5a653534..2944929a 100644 --- a/src/modules/processing/services/threads.js +++ b/src/modules/processing/services/threads.js @@ -55,7 +55,7 @@ export default async function({ user, id, quality, dispatcher }) { } // types: 640p = 101, 480p = 102, 480p-low = 103 - const selectedQualityType = quality === 'max' ? 101 : parseInt(quality) > 480 ? 102 : 101; + const selectedQualityType = quality === 'max' ? 101 : quality && parseInt(quality) <= 480 ? 102 : 101; const video = post.video_versions.find((v) => v.type === selectedQualityType) || post.video_versions.sort((a, b) => a.type - b.type)[0]; if (!video) { return { error: 'ErrorEmptyDownload' };