mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 09:42:57 -07:00
Don't show OSX Notification agent if we cannot use it. Fix.
This commit is contained in:
parent
fc76ad656c
commit
88520d488c
1 changed files with 9 additions and 1 deletions
|
@ -146,7 +146,7 @@ def available_notification_agents():
|
||||||
|
|
||||||
# OSX Notifications should only be visible if it can be used
|
# OSX Notifications should only be visible if it can be used
|
||||||
osx_notify = OSX_NOTIFY()
|
osx_notify = OSX_NOTIFY()
|
||||||
if osx_notify:
|
if osx_notify.validate():
|
||||||
agents.append({'name': 'OSX Notify',
|
agents.append({'name': 'OSX Notify',
|
||||||
'id': AGENT_IDS['OSX Notify'],
|
'id': AGENT_IDS['OSX Notify'],
|
||||||
'config_prefix': 'osx_notify',
|
'config_prefix': 'osx_notify',
|
||||||
|
@ -981,6 +981,14 @@ class OSX_NOTIFY(object):
|
||||||
try:
|
try:
|
||||||
self.objc = __import__("objc")
|
self.objc = __import__("objc")
|
||||||
self.AppKit = __import__("AppKit")
|
self.AppKit = __import__("AppKit")
|
||||||
|
except:
|
||||||
|
logger.error(u"PlexPy Notifier :: Cannot load OSX Notifications agent.")
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
try:
|
||||||
|
self.objc = __import__("objc")
|
||||||
|
self.AppKit = __import__("AppKit")
|
||||||
|
return True
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue