check year

This commit is contained in:
TPN 2024-04-05 23:28:49 +05:30 committed by GitHub
parent 68a70b1177
commit 718eb97c06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,7 +25,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
const fullSlug = movieEl.fullSlug;
return { name, year, fullSlug };
});
const targetMedia = mediaData.find((m) => m.name === ctx.media.title);
const targetMedia = mediaData.find((m) => m.name === ctx.media.title && m.year === ctx.media.releaseYear.toString());
if (!targetMedia?.fullSlug) throw new NotFoundError('No watchable item found');
let iframeSourceUrl = `/${targetMedia.fullSlug}/videos`;