sct / overseerr

Request management and media discovery tool for the Plex ecosystem
https://overseerr.dev
MIT License
3.76k stars 437 forks source link

Add ability to set Gotify notification levels #3402

Open lunchbox93 opened 1 year ago

lunchbox93 commented 1 year ago

Description

I am currently running Overseerr in docker with no operational problems. I setup Gotify notifications, and they work. My issue is that Gotify uses Priority levels (0-10) to distinguish importance of notifications. Currently, those priority levels seem to be hard-coded in Overseerr. Since they are hard-coded to level 0 and 1, I am unable to ignore any low priority notifications.

Example: I have Tautulli (via Gotify) notifications set to priority 1, since they are low priority. I have my phone setup to log but not notify all priority 1-3 notifications, because I don't need my phone to buzz everytime someone plays something. Currently, Overseerr sends notifications on priority 0 and 1. This means my phone won't alert me of a new request in Overseerr (but I can see them in my notification history). This change would allow me to set Overseerr notifications to priority 5+ so my phone will actually alert me.

I have not tried it yet, but I assume I could edit those hard-coded values to my liking, and rebuild the image.

Desired Behavior

On the Gotify notification page configuration, I would like to have a dropdown box to select the priority of the notification (0-10).

Additional Context

https://github.com/sct/overseerr/blob/develop/server/lib/notifications/agents/gotify.ts

This file is where I think the Priority values are hard-coded.

https://gotify.net/docs/more-pushmsg

This page gives more information on making calls to the Gotify API including priority.

Code of Conduct

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jernejml commented 1 year ago

I have identical issue and would appreciate such feature.

jernejml commented 1 year ago

@lunchbox93 I've manage to workaround this problem using webhooks. Example:

Webhook URL:

https://my.gotify.com/message?token=<gotify token>

JSON paylod: { "priority": 5, "notification_type": "{{notification_type}}", "subject": "{{subject}}", "message": "{{event}} - {{subject}} by {{requestedBy_username}}" }

jernejml commented 1 year ago

It's probably even easier to modify file: /app/dist/lib/notifications/agents/gotify.js

inside your container and assign higher values to priority variable:

getNotificationPayload(type, payload) { const { applicationUrl, applicationTitle } = (0, settings_1.getSettings)().main; let priority = 3;

if (type == __1.Notification.ISSUE_CREATED) { priority = 4; }

stop and start (restart) docker container and you should receive notifications.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.