Update search.ts

This commit is contained in:
erynith
2023-12-18 13:13:24 -05:00
committed by GitHub
parent 2a43934788
commit 8c97760dc0

View File

@@ -29,7 +29,11 @@ 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 || media.season.number < v.seasons || media.season.number < v.seasons + 1)); 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)
);
if (!matchingItem) return null; if (!matchingItem) return null;
return matchingItem.id; return matchingItem.id;