mirror of
https://github.com/movie-web/movie-web.git
synced 2025-01-28 05:45:29 +01:00
direct return
This commit is contained in:
parent
9495a3bf41
commit
430486a9b9
@ -47,10 +47,9 @@ export function formatTMDBMetaResult(
|
|||||||
details: TMDBShowData | TMDBMovieData,
|
details: TMDBShowData | TMDBMovieData,
|
||||||
type: MWMediaType
|
type: MWMediaType
|
||||||
): TMDBMediaResult {
|
): TMDBMediaResult {
|
||||||
let tmdbmeta;
|
|
||||||
if (type === MWMediaType.MOVIE) {
|
if (type === MWMediaType.MOVIE) {
|
||||||
const movie = details as TMDBMovieData;
|
const movie = details as TMDBMovieData;
|
||||||
tmdbmeta = {
|
return {
|
||||||
id: details.id,
|
id: details.id,
|
||||||
title: movie.title,
|
title: movie.title,
|
||||||
object_type: mediaTypeToTMDB(type),
|
object_type: mediaTypeToTMDB(type),
|
||||||
@ -60,7 +59,7 @@ export function formatTMDBMetaResult(
|
|||||||
}
|
}
|
||||||
if (type === MWMediaType.SERIES) {
|
if (type === MWMediaType.SERIES) {
|
||||||
const show = details as TMDBShowData;
|
const show = details as TMDBShowData;
|
||||||
tmdbmeta = {
|
return {
|
||||||
id: details.id,
|
id: details.id,
|
||||||
title: show.name,
|
title: show.name,
|
||||||
object_type: mediaTypeToTMDB(type),
|
object_type: mediaTypeToTMDB(type),
|
||||||
@ -74,8 +73,7 @@ export function formatTMDBMetaResult(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tmdbmeta) throw new Error("unsupported type");
|
throw new Error("unsupported type");
|
||||||
return tmdbmeta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getMetaFromId(
|
export async function getMetaFromId(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user