mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-31 19:59:31 -05:00
feat(gotify): added priority input for gotify (#1410)
* feat(gotify notification): added priority input for gotify Added priority field for gotify messages on the gotify settings page issue 562 * feat(gotify notification): added requested changes fixed json end of file new line, removed unused code, added default priority for previous configurations * feat(gotify notifcation): fixed cypress/config/settings.cypress.json fixed cypress/config/settings.cypress.json * Update cypress/config/settings.cypress.json Removed extra line from settings.cypress.json Co-authored-by: Gauthier <mail@gauthierth.fr> --------- Co-authored-by: Gauthier <mail@gauthierth.fr>
This commit is contained in:
@@ -30,7 +30,12 @@ class GotifyAgent
|
||||
public shouldSend(): boolean {
|
||||
const settings = this.getSettings();
|
||||
|
||||
if (settings.enabled && settings.options.url && settings.options.token) {
|
||||
if (
|
||||
settings.enabled &&
|
||||
settings.options.url &&
|
||||
settings.options.token &&
|
||||
settings.options.priority
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,7 +47,8 @@ class GotifyAgent
|
||||
payload: NotificationPayload
|
||||
): GotifyPayload {
|
||||
const { applicationUrl, applicationTitle } = getSettings().main;
|
||||
let priority = 0;
|
||||
const settings = this.getSettings();
|
||||
const priority = settings.options.priority ?? 1;
|
||||
|
||||
const title = payload.event
|
||||
? `${payload.event} - ${payload.subject}`
|
||||
@@ -86,10 +92,6 @@ class GotifyAgent
|
||||
message += `\n**Issue Status:** ${
|
||||
payload.issue.status === IssueStatus.OPEN ? 'Open' : 'Resolved'
|
||||
} `;
|
||||
|
||||
if (type == Notification.ISSUE_CREATED) {
|
||||
priority = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (const extra of payload.extra ?? []) {
|
||||
|
||||
Reference in New Issue
Block a user