fix: returns episode data on first page load
This commit is contained in:
@@ -209,7 +209,12 @@ class Tmdb
|
||||
continue;
|
||||
}
|
||||
|
||||
$series['episodes'][$season['season_number']] = $client->getApi()->getSeason($series['id'], $season['season_number'])['episodes'];
|
||||
$series['episodes'][$season['season_number']] = Map::from(
|
||||
$client->getApi()->getSeason($series['id'], $season['season_number'])['episodes']
|
||||
)->map(function ($data) {
|
||||
$data['poster'] = (null !== $data['still_path']) ? self::POSTER_IMG_PATH . $data['still_path'] : null;
|
||||
return $data;
|
||||
})->toArray();
|
||||
}
|
||||
return $series;
|
||||
}
|
||||
@@ -268,7 +273,7 @@ class Tmdb
|
||||
private function parseEpisode(array $data, string $posterBasePath): TmdbResult
|
||||
{
|
||||
return new TmdbResult(
|
||||
imdbId: $data['external_ids']['imdb_id'],
|
||||
imdbId: $data['external_ids']['imdb_id'] ?? $this->getImdbId($data['id'], 'tvshows'),
|
||||
tmdbId: $data['id'],
|
||||
title: $data['name'],
|
||||
poster: (null !== $data['still_path']) ? $posterBasePath . $data['still_path'] : null,
|
||||
|
||||
Reference in New Issue
Block a user