1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-21 14:47:41 +01:00

fix(meta): fallback to no "_latest"

This commit is contained in:
cloud 2023-03-09 19:22:41 -07:00
parent 935cb2427b
commit ca6383900a

View file

@ -56,9 +56,13 @@ export async function getMetaFromId(
const imdbId = data.external_ids.find( const imdbId = data.external_ids.find(
(v) => v.provider === "imdb_latest" (v) => v.provider === "imdb_latest"
)?.external_id ?? data.external_ids.find(
(v) => v.provider === "imdb"
)?.external_id; )?.external_id;
const tmdbId = data.external_ids.find( const tmdbId = data.external_ids.find(
(v) => v.provider === "tmdb_latest" (v) => v.provider === "tmdb_latest"
)?.external_id ?? data.external_ids.find(
(v) => v.provider === "tmdb"
)?.external_id; )?.external_id;
if (!imdbId || !tmdbId) throw new Error("not enough info"); if (!imdbId || !tmdbId) throw new Error("not enough info");