Update search.ts

This commit is contained in:
erynith 2023-12-18 13:13:24 -05:00 committed by GitHub
parent 2a43934788
commit 8c97760dc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

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;
return matchingItem.id;