fix: add manual imdb -> tmdb mapping for "Monster: The Ed Gein Story(2025)"
This commit is contained in:
parent
6f3233eefd
commit
405a8efad3
2 changed files with 10 additions and 0 deletions
|
|
@ -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', () => {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue