mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-28 02:31:48 +01:00
fix linting and make code nicer
This commit is contained in:
parent
84913aa63d
commit
ac28f32ef4
@ -54,16 +54,21 @@ export async function getMetaFromId(
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
const imdbId = data.external_ids.find(
|
let imdbId = data.external_ids.find(
|
||||||
(v) => v.provider === "imdb_latest"
|
(v) => v.provider === "imdb_latest"
|
||||||
)?.external_id ?? data.external_ids.find(
|
)?.external_id
|
||||||
(v) => v.provider === "imdb"
|
if (!imdbId)
|
||||||
)?.external_id;
|
imdbId = data.external_ids.find(
|
||||||
const tmdbId = data.external_ids.find(
|
(v) => v.provider === "imdb"
|
||||||
|
)?.external_id;
|
||||||
|
|
||||||
|
let tmdbId = data.external_ids.find(
|
||||||
(v) => v.provider === "tmdb_latest"
|
(v) => v.provider === "tmdb_latest"
|
||||||
)?.external_id ?? data.external_ids.find(
|
)?.external_id
|
||||||
(v) => v.provider === "tmdb"
|
if (!tmdbId)
|
||||||
)?.external_id;
|
tmdbId = data.external_ids.find(
|
||||||
|
(v) => v.provider === "tmdb"
|
||||||
|
)?.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