@php $duration = $value['duration'] ?? ($value['entertainment_type'] == 'video' && isset($value->video['duration']) ? $value->video['duration'] : (isset($value->entertainment['duration']) ? $value->entertainment['duration'] : '00:00')); $name = $value['name'] ?? ($value['entertainment_type'] == 'video' && isset($value->video['name']) ? $value->video['name'] : (isset($value->entertainment['name']) ? $value->entertainment['name'] : 'Unknown')); $poster_image = $value['poster_image'] ?? ($value['entertainment_type'] == 'video' && isset($value->video['poster_url']) ? setBaseUrlWithFileName($value->video['poster_url']) : (isset($value->entertainment['poster_url']) ? setBaseUrlWithFileName($value->entertainment['poster_url']) : 'default-poster.jpg')); if (!function_exists('convertSeconds')) { function convertSeconds($time) { [$hours, $minutes, $seconds] = array_map('intval', explode(':', $time)); return $hours * 3600 + $minutes * 60 + $seconds; } } $total_watched_time = $value['total_watched_time'] ?? '00:00:00'; $totalDurationInSeconds = convertSeconds($total_watched_time); $watchedTime = $value['watched_time'] ?? '00:00:00'; $watchedTimeInSeconds = convertSeconds($watchedTime); $progressPercentage = $totalDurationInSeconds > 0 ? ($watchedTimeInSeconds / $totalDurationInSeconds) * 100 : 0; @endphp
@if($value['entertainment_type'] == 'episode' || $value['entertainment_type'] == 'tvshow') @if(isset($value['episode_id']) && $value['episode_id'] != null) movie-card @else movie-card @endif @endif @if($value['entertainment_type'] == 'movie') movie-card @endif @if($value['entertainment_type'] == 'video') movie-card @endif
@if($value['entertainment_type'] == 'episode' || $value['entertainment_type'] == 'tvshow') @if(isset($value['episode_id']) && $value['episode_id'] != null)
{{ $name }}
@else
{{ $name }}
@endif @endif @if($value['entertainment_type'] == 'movie')
{{ $name }}
@endif @if($value['entertainment_type'] == 'video')
{{ $name }}
@endif {{ $duration }}