From 567ebe3c33c71eb644208d3368b54963a889ce02 Mon Sep 17 00:00:00 2001 From: maher Date: Sat, 6 Jun 2026 16:07:01 +0200 Subject: [PATCH] correction bug lancer --- public/assets/js/frontend.js | 5 +++-- src/Controller/Frontend/HomeController.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/assets/js/frontend.js b/public/assets/js/frontend.js index 5136932..cbb2490 100644 --- a/public/assets/js/frontend.js +++ b/public/assets/js/frontend.js @@ -160,7 +160,7 @@ $(function () { else if (status === 'background_ready') { progressHtml = `
`; statusHtml = ` Prêt pour tâche de fond`; - actionHtml = ``; + actionHtml = ``; } else if (status === 'ready_stream') { // Transition rapide, normalement ne devrait pas rester visible @@ -309,11 +309,12 @@ $(function () { const action = $(this).data('action'); const entry = videoEntries.find(e => e.id === entryId); if (!entry) return; - + if (action === 'login') { window.open(ENDPOINTS.urlAuth, "_self"); } else if (action === 'startBg') { + if (entry.status === 'background_ready') { await launchBackground(entry); // Après fin du background, la queue pourrait reprendre s'il y a d'autres pending, diff --git a/src/Controller/Frontend/HomeController.php b/src/Controller/Frontend/HomeController.php index 8d25cc2..2778d71 100644 --- a/src/Controller/Frontend/HomeController.php +++ b/src/Controller/Frontend/HomeController.php @@ -324,8 +324,8 @@ final class HomeController extends AbstractController // 2. Suppression du fichier physique (si présent) $path = $this->projectDir . '/public/downloader/user/'; - $filePath = $path . $this->getUser()->getId() . '/' . $userDownloader->getName(); - + $filePath = $path . $this->getUser()->getId() . '/' . $userDownloader->getNameFile(); + if ($this->filesystem->exists($filePath)) { $this->filesystem->remove($filePath); } @@ -349,7 +349,7 @@ final class HomeController extends AbstractController #[Route('/test', name: 'app_test')] public function test() { - + die; return $this->render('/frontend/test.html.twig', []); } }