Skip to content

best way to save what you love

vimeo: fall back to `width` for quality label if unable to map

dumbmoron7420337ea2f5
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"
}
}