check year

This commit is contained in:
TPN
2024-04-05 23:28:49 +05:30
committed by GitHub
parent 68a70b1177
commit 718eb97c06

View File

@@ -25,7 +25,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
const fullSlug = movieEl.fullSlug; const fullSlug = movieEl.fullSlug;
return { name, year, 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'); if (!targetMedia?.fullSlug) throw new NotFoundError('No watchable item found');
let iframeSourceUrl = `/${targetMedia.fullSlug}/videos`; let iframeSourceUrl = `/${targetMedia.fullSlug}/videos`;