YuriyGuts/syno-plex-update

Enhancement: Notification Support

Opened this issue · 5 comments

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.

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.

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

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.

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.

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.