Fixed Channel Anal thumbnail fallbacks.
This commit is contained in:
@@ -4,9 +4,10 @@ const unprint = require('unprint');
|
|||||||
|
|
||||||
const slugify = require('../utils/slugify');
|
const slugify = require('../utils/slugify');
|
||||||
|
|
||||||
function extractEntryId(poster) {
|
function extractEntryId(posters) {
|
||||||
try {
|
try {
|
||||||
return slugify(new URL(poster).pathname.match(/\/images\/(.*?)\.[a-z]{3,4}/i)?.[1]?.replace(/smak.*/i, ''), '');
|
const poster = [].concat(posters).filter(Boolean)[0];
|
||||||
|
return slugify(new URL(poster.src || poster).pathname.match(/\/images\/(.*?)\.[a-z]{3,4}/i)?.[1]?.replace(/smak.*/i, ''), '');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -48,14 +49,26 @@ function getPhotos(poster) {
|
|||||||
|
|
||||||
if (photo === poster) {
|
if (photo === poster) {
|
||||||
return {
|
return {
|
||||||
poster,
|
poster: {
|
||||||
|
src: poster,
|
||||||
|
verifyType: 'image',
|
||||||
|
},
|
||||||
photos: [],
|
photos: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
poster: [photo, poster],
|
poster: [{
|
||||||
photos: [poster],
|
src: photo,
|
||||||
|
verifyType: 'image',
|
||||||
|
}, {
|
||||||
|
src: poster,
|
||||||
|
verifyType: 'image',
|
||||||
|
}],
|
||||||
|
photos: [{
|
||||||
|
src: poster,
|
||||||
|
verifyType: 'image',
|
||||||
|
}],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user