render('monitor/index.html.twig'); } #[Route('/monitors/upcoming-episodes', name: 'app.monitor.upcoming-episodes', methods: ['GET'])] public function upcomingEpisodes() { return $this->render('monitor/upcoming-episodes.html.twig'); } #[Route('/monitors/{id}', name: 'app.monitor.view', methods: ['GET'])] public function viewMonitor(Monitor $monitor, GetMediaInfoHandler $getMediaInfoHandler, GetMediaInfoFromLibraryHandler $handler) { $media = $getMediaInfoHandler->handle( new GetMediaInfoCommand( imdbId: $monitor->getImdbId(), mediaType: 'tvshows', ) ); $libraryResult = $handler->handle( new GetMediaFromLibraryCommand( $this->getUser()->getId(), $media->media->mediaType, $media->media->imdbId, $media->media->title, ) ); return $this->render('monitor/view.html.twig', [ 'monitor' => $monitor, 'results' => $media, 'library' => $libraryResult ]); } }