Fix year NaN, no longer open unreleased

This commit is contained in:
Jorrin
2024-04-02 15:38:21 +02:00
parent 44647a4141
commit 471be3b551
6 changed files with 47 additions and 18 deletions

View File

@@ -150,6 +150,9 @@ async function fetchSearchResults(query: string): Promise<ItemData[]> {
id: result.id.toString(),
title: result.media_type === "tv" ? result.name : result.title,
posterUrl: getMediaPoster(result.poster_path),
release_date: new Date(
result.media_type === "tv" ? result.first_air_date : result.release_date,
),
year: new Date(
result.media_type === "tv" ? result.first_air_date : result.release_date,
).getFullYear(),