mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-21 14:47:41 +01:00
remove seasons from search result
This commit is contained in:
parent
4f5a926c90
commit
5661a7873a
1 changed files with 1 additions and 12 deletions
|
@ -202,29 +202,18 @@ export async function formatTMDBSearchResult(
|
||||||
mediatype: TMDBContentTypes
|
mediatype: TMDBContentTypes
|
||||||
): Promise<TMDBMediaResult> {
|
): Promise<TMDBMediaResult> {
|
||||||
const type = TMDBMediaToMediaType(mediatype);
|
const type = TMDBMediaToMediaType(mediatype);
|
||||||
const details = await Tmdb.getMediaDetails(result.id.toString(), mediatype);
|
|
||||||
|
|
||||||
const seasons =
|
|
||||||
type === MWMediaType.SERIES
|
|
||||||
? (details as TMDBShowData).seasons?.map((v) => ({
|
|
||||||
id: v.id,
|
|
||||||
title: v.name,
|
|
||||||
season_number: v.season_number,
|
|
||||||
}))
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title:
|
title:
|
||||||
type === MWMediaType.SERIES
|
type === MWMediaType.SERIES
|
||||||
? (result as TMDBShowResult).name
|
? (result as TMDBShowResult).name
|
||||||
: (result as TMDBMovieResult).title,
|
: (result as TMDBMovieResult).title,
|
||||||
poster: Tmdb.getMediaPoster(details.poster_path),
|
poster: Tmdb.getMediaPoster(result.poster_path),
|
||||||
id: result.id,
|
id: result.id,
|
||||||
original_release_year:
|
original_release_year:
|
||||||
type === MWMediaType.SERIES
|
type === MWMediaType.SERIES
|
||||||
? Number((result as TMDBShowResult).first_air_date?.split("-")[0])
|
? Number((result as TMDBShowResult).first_air_date?.split("-")[0])
|
||||||
: Number((result as TMDBMovieResult).release_date?.split("-")[0]),
|
: Number((result as TMDBMovieResult).release_date?.split("-")[0]),
|
||||||
object_type: mediaTypeToTMDB(type),
|
object_type: mediaTypeToTMDB(type),
|
||||||
seasons,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue