Skip to content

Enhancement: Notification Support #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
epheterson opened this issue Dec 13, 2021 · 5 comments
Open

Enhancement: Notification Support #4

epheterson opened this issue Dec 13, 2021 · 5 comments

Comments

@epheterson
Copy link

Hey, can you add the ability to post notifications to Notification Center.

It's probably okay to be silent if nothing happens, and post a new notification on errors or successful updates only.

@YuriyGuts
Copy link
Owner

Yes, this capability currently exists. A notification is created when the script detects a newer version.

function notify_update_available {
# Create a DSM notification that a new update is available.
synonotify PKGHasUpgrade '{"%PKG_HAS_UPDATE%": "Plex Media Server", "%COMPANY_NAME%": "Plex Inc."}'
}

It would be nice to include a custom message indicating whether the update was successful or not, but I couldn't find any documentation for synonotify at the time. It seems it has a fixed list of notification types and adding a custom notification is fairly non-trivial. However, if you know an easy way to do this, I'm happy to make this improvement.

@epheterson
Copy link
Author

Oh whoops, I didn't have an update this time and didn't notice that it's supported already. My bad!

No need for various update types, just change the text of the notification depending on the result. That's how this other package works, but they have an issue populating the notification DSM 7 so I found yours as an alternative.

https://github.com/cowboy/synology-update-plex

@epheterson
Copy link
Author

Hey, I got a new Plex version installed last night but did not get a notification. Is there anyway to debug / troubleshoot why I didn't? The output of the script's previous run showed a successful update, and my Package Center had notified me Plex had an update, but no messages from the script at all.

@YuriyGuts
Copy link
Owner

Yes, the notification should be coming from Package Center and it should look like this:

image

To check if the notifications are triggered successfully by the script, you can try running this command manually from the root shell:

synonotify PKGHasUpgrade '{"%PKG_HAS_UPDATE%": "Plex Media Server", "%COMPANY_NAME%": "Plex Inc."}'

And a notification similar to the one shown above should appear.

@epheterson
Copy link
Author

Hey, yeah that is the one I saw! Thanks, can we look into posting a more accurate notification? At the time that notification is seen, there is no longer a new update available, and I'm never to go to Package Center to install it, as it instructs. Not sure what the options are, but I believe a previous Plex updater I had (didn't work with DSM 7) had a clearer notification flow that did not mention Package Center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants