From 7420337ea2f51d7d143b4fc9a2604c4e6ec77998 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Mon, 4 Mar 2024 23:25:46 +0000 Subject: [PATCH] vimeo: fall back to `width` for quality label if unable to map --- src/modules/processing/services/vimeo.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/processing/services/vimeo.js b/src/modules/processing/services/vimeo.js index db623bdb..7c6aab94 100644 --- a/src/modules/processing/services/vimeo.js +++ b/src/modules/processing/services/vimeo.js @@ -71,6 +71,7 @@ export default async function(obj) { } let masterM3U8 = `${masterJSONURL.split("/sep/")[0]}/sep/video/${bestVideo.id}/master.m3u8`; + const fallbackResolution = bestVideo.height > bestVideo.width ? bestVideo.width : bestVideo.height; return { urls: masterM3U8, @@ -81,8 +82,8 @@ export default async function(obj) { id: obj.id, title: fileMetadata.title, author: fileMetadata.artist, - resolution: `${bestVideo["width"]}x${bestVideo["height"]}`, - qualityLabel: `${resolutionMatch[bestVideo["width"]]}p`, + resolution: `${bestVideo.width}x${bestVideo.height}`, + qualityLabel: `${resolutionMatch[bestVideo.width] || fallbackResolution}p`, extension: "mp4" } }