fix: add manual imdb -> tmdb mapping for "Monster: The Ed Gein Story(2025)"

This commit is contained in:
WebStreamr 2025-10-15 19:52:20 +00:00
parent 6f3233eefd
commit 405a8efad3
No known key found for this signature in database
2 changed files with 10 additions and 0 deletions

View file

@ -47,6 +47,10 @@ describe('getTmdbIdFromImdbId', () => {
test('throws with invalid imdb id', async () => {
await expect(getTmdbIdFromImdbId(ctx, fetcher, new ImdbId('tt12345678', 1, 1))).rejects.toThrow('Could not get TMDB ID of IMDb ID "tt12345678"');
});
test('Monster: The Ed Gein Story (2025)', async () => {
expect(await getTmdbIdFromImdbId(ctx, fetcher, new ImdbId('tt13207736', 3, 2))).toStrictEqual(new TmdbId(286801, 1, 2));
});
});
describe('getImdbIdFromTmdbId', () => {

View file

@ -67,6 +67,12 @@ const tmdbFetch = async (ctx: Context, fetcher: Fetcher, path: string, searchPar
const imdbTmdbMap = new Map<string, number>();
export const getTmdbIdFromImdbId = async (ctx: Context, fetcher: Fetcher, imdbId: ImdbId): Promise<TmdbId> => {
// Manual mismatch fixes
if (imdbId.id === 'tt13207736' && imdbId.season === 3) {
// Monster: The Ed Gein Story (2025)
return new TmdbId(286801, imdbId.season - 2, imdbId.episode);
}
if (imdbTmdbMap.has(imdbId.id)) {
return new TmdbId(imdbTmdbMap.get(imdbId.id) as number, imdbId.season, imdbId.episode);
}