Compare commits

...

2 Commits

Author SHA1 Message Date
575fc08f24 fix: cleanup 2025-08-09 00:24:31 -05:00
87bdde801d fix: updates config resolver 2025-08-08 23:48:30 -05:00
3 changed files with 29 additions and 2 deletions

View File

@@ -38,6 +38,12 @@ final class ConfigResolver
#[Autowire(param: 'auth.oidc.bypass_form_login')] #[Autowire(param: 'auth.oidc.bypass_form_login')]
private ?bool $authOidcBypassFormLogin = null, private ?bool $authOidcBypassFormLogin = null,
#[Autowire(param: 'notification.transport')]
private ?string $notificationTransport = null,
#[Autowire(param: 'notification.ntfy.dsn')]
private ?string $notificationNtfyDsn = null,
) {} ) {}
public function validate(): bool public function validate(): bool
@@ -54,6 +60,12 @@ final class ConfigResolver
$valid = false; $valid = false;
} }
if (null !== $this->notificationTransport) {
if (null === $this->notificationNtfyDsn || "" === $this->notificationNtfyDsn) {
$this->messages[] = "Your NOTIFICATION_TRANSPORT is set to 'ntfy' but you don't have the NTFY_DSN environment variable set.";
}
}
return $valid; return $valid;
} }

View File

@@ -84,7 +84,7 @@ class ProcessDownloader implements DownloaderInterface
}); });
if ($downloadEntity->getStatus() !== 'Paused') { if ($downloadEntity->getStatus() !== 'Paused') {
$downloadEntity->setProgress(100); $downloadEntity->setProgress(100);
$this->broadcaster->alert('Success', '"'.$title.'" has finished downloading."', sendPush: true); $this->alertComplete($downloadEntity);
} }
} catch (ProcessFailedException $exception) { } catch (ProcessFailedException $exception) {
$downloadEntity->setStatus('Failed'); $downloadEntity->setStatus('Failed');
@@ -108,4 +108,15 @@ class ProcessDownloader implements DownloaderInterface
throw new \Exception("There is no download path for media type: $mediaType"); 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);
}
} }

View File

@@ -55,7 +55,11 @@
<turbo-stream action="prepend" target="alert_list"> <turbo-stream action="prepend" target="alert_list">
<template> <template>
<twig:Alert title="Finished downloading" message="{{ entity.title }}" alert_id="{{ entity.id }}" data-controller="alert" /> {% if entity.mediaType == "tvshows" %}
<twig:Alert title="Success" message="{{ entity.title }} - ({{ entity.episodeId }}) has finished downloading." alert_id="{{ entity.id }}" data-controller="alert" />
{% else %}
<twig:Alert title="Success" message="{{ entity.title }} has finished downloading." alert_id="{{ entity.id }}" data-controller="alert" />
{% endif %}
</template> </template>
</turbo-stream> </turbo-stream>