mirror of
https://github.com/p-stream/providers.git
synced 2026-04-19 18:22:04 +00:00
Update search.ts
This commit is contained in:
parent
8c97760dc0
commit
7fa098fb0c
1 changed files with 9 additions and 5 deletions
|
|
@ -29,11 +29,15 @@ export async function getFlixhqId(ctx: ScrapeContext, media: MovieMedia | ShowMe
|
|||
};
|
||||
});
|
||||
|
||||
const matchingItem = items.find(
|
||||
(v) => v &&
|
||||
(media.type === 'movie' ? compareMedia(media, v.title, v.year) :
|
||||
compareTitle(media.title, v.title) && media.season.number < v.seasons + 1)
|
||||
);
|
||||
const matchingItem = items.find(v => {
|
||||
if (!v) return false;
|
||||
|
||||
if (media.type === 'movie') {
|
||||
return compareMedia(media, v.title, v.year)
|
||||
}
|
||||
|
||||
return compareTitle(media.title, v.title) && media.season.number < v.seasons + 1
|
||||
});
|
||||
|
||||
if (!matchingItem) return null;
|
||||
return matchingItem.id;
|
||||
|
|
|
|||
Loading…
Reference in a new issue