Moved all preferred resolutions to config.

This commit is contained in:
ThePendulum 2020-01-30 04:14:51 +01:00
parent d9623789bd
commit 0b4a1a5232
2 changed files with 4 additions and 2 deletions

View File

@ -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
},
};

View File

@ -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;