Fixed Channel Anal thumbnail fallbacks.
This commit is contained in:
@@ -4,9 +4,10 @@ const unprint = require('unprint');
|
||||
|
||||
const slugify = require('../utils/slugify');
|
||||
|
||||
function extractEntryId(poster) {
|
||||
function extractEntryId(posters) {
|
||||
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) {
|
||||
return null;
|
||||
}
|
||||
@@ -48,14 +49,26 @@ function getPhotos(poster) {
|
||||
|
||||
if (photo === poster) {
|
||||
return {
|
||||
poster,
|
||||
poster: {
|
||||
src: poster,
|
||||
verifyType: 'image',
|
||||
},
|
||||
photos: [],
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
poster: [photo, poster],
|
||||
photos: [poster],
|
||||
poster: [{
|
||||
src: photo,
|
||||
verifyType: 'image',
|
||||
}, {
|
||||
src: poster,
|
||||
verifyType: 'image',
|
||||
}],
|
||||
photos: [{
|
||||
src: poster,
|
||||
verifyType: 'image',
|
||||
}],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user