feat: button to add movie monitor

This commit is contained in:
2025-05-03 11:53:23 -05:00
parent babcb00440
commit 5688b3a0df
9 changed files with 166 additions and 7 deletions

View File

@@ -2,6 +2,9 @@
namespace App\Controller;
use App\Download\Action\Command\AddMovieMonitorCommand;
use App\Download\Action\Handler\AddMovieMonitorHandler;
use App\Download\Action\Input\AddMovieMonitorInput;
use App\Download\Action\Input\DownloadMediaInput;
use App\Download\Framework\Repository\DownloadRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@@ -37,4 +40,16 @@ class DownloadController extends AbstractController
return $this->json(['status' => 200, 'message' => 'Added to Queue']);
}
#[Route('/monitor/movies/{tmdbId}/{imdbId}/{title}', name: 'app_add_movie_monitor', methods: ['GET', 'POST'])]
public function addMonitor(
AddMovieMonitorInput $input,
AddMovieMonitorHandler $handler,
) {
$handler->handle($input->toCommand());
return $this->json([
'status' => 200,
'message' => $input
]);
}
}