From 0b4a1a523231255c6173e7d00fdcd1f673c8acd1 Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Thu, 30 Jan 2020 04:14:51 +0100 Subject: [PATCH] Moved all preferred resolutions to config. --- config/default.js | 2 +- src/media.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/default.js b/config/default.js index a26aaff5..5d16b626 100644 --- a/config/default.js +++ b/config/default.js @@ -44,7 +44,7 @@ module.exports = { path: './media', thumbnailSize: 320, // width for 16:9 will be exactly 576px thumbnailQuality: 100, - trailerQuality: 480, + trailerQuality: [480, 540], limit: 25, // max number of photos per release }, }; diff --git a/src/media.js b/src/media.js index c7299eca..f962abfd 100644 --- a/src/media.js +++ b/src/media.js @@ -290,9 +290,11 @@ async function storeTrailer(trailers, { }, label) { // support scrapers supplying multiple qualities const trailer = Array.isArray(trailers) - ? trailers.find(trailerX => [config.media.trailerQuality, 480, 720, 1080].includes(trailerX.quality)) || trailers[0] + ? trailers.find(trailerX => config.media.trailerQuality.includes(trailerX.quality)) || trailers[0] : trailers; + console.log(trailer); + if (!trailer || !trailer.src) { logger.info(`No trailer available for ${label}`); return;