From 575fc08f2413c2f52cd970f1255d477dc35af5c4 Mon Sep 17 00:00:00 2001 From: Brock H Caldwell Date: Sat, 9 Aug 2025 00:24:31 -0500 Subject: [PATCH] fix: cleanup --- src/Download/Downloader/ProcessDownloader.php | 13 ++++++++++++- templates/broadcast/Download.stream.html.twig | 6 +++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Download/Downloader/ProcessDownloader.php b/src/Download/Downloader/ProcessDownloader.php index 3dbc744..5931181 100644 --- a/src/Download/Downloader/ProcessDownloader.php +++ b/src/Download/Downloader/ProcessDownloader.php @@ -84,7 +84,7 @@ class ProcessDownloader implements DownloaderInterface }); if ($downloadEntity->getStatus() !== 'Paused') { $downloadEntity->setProgress(100); - $this->broadcaster->alert('Success', '"'.$title.'" has finished downloading."', sendPush: true); + $this->alertComplete($downloadEntity); } } catch (ProcessFailedException $exception) { $downloadEntity->setStatus('Failed'); @@ -108,4 +108,15 @@ class ProcessDownloader implements DownloaderInterface throw new \Exception("There is no download path for media type: $mediaType"); } + + private function alertComplete(Download $download): void + { + if ("tvshows" === $download->getMediaType()) { + $message = '"' . $download->getTitle() . '" - ' . $download->getEpisodeId() . ' has finished downloading.'; + } else { + $message = '"' . $download->getTitle() . '" has finished downloading.'; + } + + $this->broadcaster->alert('Success', $message, sendPush: true); + } } \ No newline at end of file diff --git a/templates/broadcast/Download.stream.html.twig b/templates/broadcast/Download.stream.html.twig index 932dcb3..b667352 100644 --- a/templates/broadcast/Download.stream.html.twig +++ b/templates/broadcast/Download.stream.html.twig @@ -55,7 +55,11 @@