Update search.ts

This commit is contained in:
erynith
2023-12-18 14:15:16 -05:00
committed by GitHub
parent 9ff9cc5938
commit 2e3ee28503

View File

@@ -18,18 +18,18 @@ export async function getFlixhqId(ctx: ScrapeContext, media: MovieMedia | ShowMe
const id = query.find('div.film-poster > a').attr('href')?.slice(1); const id = query.find('div.film-poster > a').attr('href')?.slice(1);
const title = query.find('div.film-detail > h2 > a').attr('title'); const title = query.find('div.film-detail > h2 > a').attr('title');
const year = query.find('div.film-detail > div.fd-infor > span:nth-child(1)').text(); const year = query.find('div.film-detail > div.fd-infor > span:nth-child(1)').text();
const seasons = year.includes('SS') ? parseInt(year.split('SS')[1]) : 0; const seasons = year.includes('SS') ? year.split('SS')[1] : "0";
if (!id || !title || !year) return null; if (!id || !title || !year) return null;
return { return {
id, id,
title, title,
year: parseInt(year, 10), year: parseInt(year, 10),
seasons, seasons: parseInt(seasons, 10),
}; };
}); });
const matchingItem = items.find(v => { const matchingItem = items.find((v) => {
if (!v) return false; if (!v) return false;
if (media.type === 'movie') { if (media.type === 'movie') {