diff --git a/app/Http/Controllers/ShowController.php b/app/Http/Controllers/ShowController.php index 905facd..9cd83d1 100644 --- a/app/Http/Controllers/ShowController.php +++ b/app/Http/Controllers/ShowController.php @@ -46,7 +46,7 @@ public function index(TmdbClient $tmdb, ApiClient $api, int $id, string $slug) $meta['description'] = Str::limit(Str::replace(['{OVERVIEW}'], [$data['overview']], config('site.shows.detail.description')), 150); $meta['keywords'] = config('site.shows.detail.keywords', ''); - $is_show_page = false; + $is_show_page = true; $show = $data; // dd($season); $season = false; diff --git a/resources/views/show.blade.php b/resources/views/show.blade.php index d222f08..e01f0f8 100644 --- a/resources/views/show.blade.php +++ b/resources/views/show.blade.php @@ -68,7 +68,7 @@ - {{$show['vote_average']}} + {{ $episode['vote_average'] ?? $season['vote_average'] ?? $show['vote_average'] }} @@ -104,7 +104,7 @@

Details

-

{{ $show['overview'] }}

+

{{ $episode['overview'] ?? $season['overview'] ?? $show['overview'] }}

  • @@ -131,9 +131,20 @@
  • Cast: - @foreach($show['cast'] as $actor) - {{ $actor['name'] }} @if(!$loop->last), @endif - @endforeach + @if ($episode && !empty($episode['cast'])) + @foreach($episode['cast'] as $actor) + {{ $actor['name'] }} @if(!$loop->last), @endif + @endforeach + @elseif ($season && !empty($season['cast']) && !$is_show_page) + @foreach($season['cast'] as $actor) + {{ $actor['name'] }} @if(!$loop->last), @endif + @endforeach + @else + @foreach($show['cast'] as $actor) + {{ $actor['name'] }} @if(!$loop->last), @endif + @endforeach + @endif +
  • Creator: @@ -143,16 +154,26 @@ @endforeach
  • - @unless (empty($show['crew']['producers'])) - + @if (($episode && !empty($episode['crew']['producers'])) || ($season && !empty($season['crew']['producers'])) || empty($show['crew']['producers']))
  • Producer: + @if ($episode && !empty($episode['crew']['producers'])) + @foreach($episode['crew']['producers'] as $actor) + {{ $actor['name'] }}@if(!$loop->last), @endif + @endforeach + @elseif ($season && !empty($season['crew']['producers']) && !$is_show_page) + @foreach($season['crew']['producers'] as $actor) + {{ $actor['name'] }}@if(!$loop->last), @endif + @endforeach + @else @foreach($show['crew']['producers'] as $actor) {{ $actor['name'] }}@if(!$loop->last), @endif - @endforeach -
  • - @endunless + @endforeach + @endif + + + @endif