'Show', 'tvseason' => 'Season', 'tvepisode' => 'Episode', ]; return $types[$type] ?? '-'; } #[AsTwigFilter('as_download_type')] public function monitorTypeToDownloadType(string $type) { $types = [ 'tvshows' => 'tvshows', 'tvseason' => 'tvshows', 'tvepisode' => 'tvshows', 'movie' => 'movies', ]; return $types[$type] ?? '-'; } #[AsTwigFilter('monitor_media_id')] public function mediaId(Monitor $monitor) { if ($monitor->getMonitorType() === "tvseason") { return "S". str_pad($monitor->getSeason(), 2, "0", STR_PAD_LEFT); } if ($monitor->getMonitorType() === "tvepisode") { return "S". str_pad($monitor->getSeason(), 2, "0", STR_PAD_LEFT) . "E". str_pad($monitor->getEpisode(), 2, "0", STR_PAD_LEFT); } return "-"; } }