Benachrichtigungen: ntfy ersetzt durch Discord-Webhooks
User-Wunsch: Discord statt ntfy. notify.ts sendet jetzt einen JSON-Webhook-POST
({username, content} mit fettem Titel + Nachricht, auf Discords 2000-Zeichen-
Limit gekappt) statt ntfy-Headern. Emoji-Status im Titel (OK/Fehler/Ziel-
flagge) ersetzt Priority/Tags. Settings-UI: Label/Placeholder/Hinweis auf
Discord-Webhook umgestellt (Servereinstellungen -> Integrationen -> Webhooks).
Hooks, Dedup und Guards unveraendert. Tests auf das JSON-Format angepasst
(inkl. Discord-204-Antwort und 2000-Zeichen-Cap).
This commit is contained in:
@@ -10496,10 +10496,8 @@ export class DownloadManager extends EventEmitter {
|
||||
}
|
||||
this.notifiedPackages.add(pkg.id);
|
||||
void sendNotification(url, {
|
||||
title: kind === "completed" ? "Paket fertig" : "Paket fehlgeschlagen",
|
||||
message: `${pkg.name}\n${detail}`,
|
||||
priority: kind === "failed" ? "high" : "default",
|
||||
tags: kind === "completed" ? "white_check_mark" : "x"
|
||||
title: kind === "completed" ? "✅ Paket fertig" : "❌ Paket fehlgeschlagen",
|
||||
message: `${pkg.name}\n${detail}`
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12122,10 +12120,8 @@ export class DownloadManager extends EventEmitter {
|
||||
this.session.summaryText = `Summary: Dauer ${duration}s, Ø Speed ${humanSize(avgSpeed)}/s, Erfolg ${success}/${total}`;
|
||||
if (this.settings.notifyOnRunFinished && total > 0) {
|
||||
void sendNotification(this.settings.notifyUrl, {
|
||||
title: "Durchlauf beendet",
|
||||
message: `${success}/${total} erfolgreich, ${failed} fehlgeschlagen, ${cancelled} abgebrochen\nDauer ${duration}s, Durchschnitt ${humanSize(avgSpeed)}/s`,
|
||||
priority: failed > 0 ? "high" : "default",
|
||||
tags: failed > 0 ? "warning" : "checkered_flag"
|
||||
title: failed > 0 ? "⚠️ Durchlauf beendet" : "🏁 Durchlauf beendet",
|
||||
message: `${success}/${total} erfolgreich, ${failed} fehlgeschlagen, ${cancelled} abgebrochen\nDauer ${duration}s, Durchschnitt ${humanSize(avgSpeed)}/s`
|
||||
});
|
||||
}
|
||||
this.runItemIds.clear();
|
||||
|
||||
Reference in New Issue
Block a user