mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-28 18:21:52 +01:00
fix(meta): fallback to no "_latest"
This commit is contained in:
parent
935cb2427b
commit
ca6383900a
@ -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");
|
||||||
|
Loading…
Reference in New Issue
Block a user