feat: additional info displayed on child monitor page

This commit is contained in:
Brock H Caldwell
2025-11-07 12:59:24 -06:00
parent f4982af991
commit 4ae70115b5
8 changed files with 592 additions and 21 deletions

View File

@@ -3,6 +3,8 @@
namespace App\Monitor\Framework\Controller;
use App\Download\Action\Input\DeleteDownloadInput;
use App\Library\Action\Command\GetMediaFromLibraryCommand;
use App\Library\Action\Handler\GetMediaInfoFromLibraryHandler;
use App\Monitor\Action\Handler\AddMonitorHandler;
use App\Monitor\Action\Handler\DeleteMonitorHandler;
use App\Monitor\Action\Input\AddMonitorInput;
@@ -40,7 +42,7 @@ class WebController extends AbstractController
}
#[Route('/monitors/{id}', name: 'app.monitor.view', methods: ['GET'])]
public function viewMonitor(Monitor $monitor, GetMediaInfoHandler $getMediaInfoHandler)
public function viewMonitor(Monitor $monitor, GetMediaInfoHandler $getMediaInfoHandler, GetMediaInfoFromLibraryHandler $handler)
{
$media = $getMediaInfoHandler->handle(
new GetMediaInfoCommand(
@@ -48,9 +50,19 @@ class WebController extends AbstractController
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
]);
}
}