mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-30 16:17:41 +01:00
fix(meta): fallback to no "_latest"
This commit is contained in:
parent
935cb2427b
commit
ca6383900a
1 changed files with 4 additions and 0 deletions
|
@ -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 a new issue