feat: ntfy integration

This commit is contained in:
2025-08-08 23:38:53 -05:00
parent caeda625fd
commit 7d35b6266b
8 changed files with 229 additions and 13 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Download\Downloader;
use App\Base\Service\Broadcaster;
use App\Base\Service\MediaFiles;
use App\Download\Framework\Entity\Download;
use Doctrine\ORM\EntityManagerInterface;
@@ -19,6 +20,7 @@ class ProcessDownloader implements DownloaderInterface
private EntityManagerInterface $entityManager,
private MediaFiles $mediaFiles,
private CacheInterface $cache,
private readonly Broadcaster $broadcaster,
) {}
/**
@@ -82,6 +84,7 @@ class ProcessDownloader implements DownloaderInterface
});
if ($downloadEntity->getStatus() !== 'Paused') {
$downloadEntity->setProgress(100);
$this->broadcaster->alert('Success', '"'.$title.'" has finished downloading."', sendPush: true);
}
} catch (ProcessFailedException $exception) {
$downloadEntity->setStatus('Failed');