1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

parse dates instead of cringe string manipulation

This commit is contained in:
adrifcastr 2023-06-21 12:50:41 +02:00
parent 430486a9b9
commit 984d215312

View file

@ -54,7 +54,7 @@ export function formatTMDBMetaResult(
title: movie.title,
object_type: mediaTypeToTMDB(type),
poster: movie.poster_path ?? undefined,
original_release_year: Number(movie.release_date?.split("-")[0]),
original_release_year: new Date(movie.release_date).getFullYear(),
};
}
if (type === MWMediaType.SERIES) {
@ -69,7 +69,7 @@ export function formatTMDBMetaResult(
title: v.name,
})),
poster: (details as TMDBMovieData).poster_path ?? undefined,
original_release_year: Number(show.first_air_date?.split("-")[0]),
original_release_year: new Date(show.first_air_date).getFullYear(),
};
}