Browse Source

Notify when a new CP version is available. close #56

pull/62/head
Ruud 14 years ago
parent
commit
5f673f95e5
  1. 2
      couchpotato/core/notifications/base.py
  2. 6
      couchpotato/core/plugins/updater/__init__.py
  3. 1
      couchpotato/core/plugins/updater/main.py

2
couchpotato/core/notifications/base.py

@ -12,7 +12,7 @@ class Notification(Plugin):
default_title = 'CouchPotato' default_title = 'CouchPotato'
test_message = 'ZOMG Lazors Pewpewpew!' test_message = 'ZOMG Lazors Pewpewpew!'
listen_to = ['movie.downloaded', 'movie.snatched'] listen_to = ['movie.downloaded', 'movie.snatched', 'updater.available']
dont_listen_to = [] dont_listen_to = []
def __init__(self): def __init__(self):

6
couchpotato/core/plugins/updater/__init__.py

@ -19,6 +19,12 @@ config = [{
'type': 'enabler', 'type': 'enabler',
}, },
{ {
'name': 'notification',
'type': 'bool',
'default': True,
'description': 'Send a notification if an update is available.',
},
{
'name': 'automatic', 'name': 'automatic',
'default': True, 'default': True,
'type': 'bool', 'type': 'bool',

1
couchpotato/core/plugins/updater/main.py

@ -78,6 +78,7 @@ class Updater(Plugin):
self.doUpdate() self.doUpdate()
else: else:
self.update_version = remote.hash self.update_version = remote.hash
fireEvent('updater.available', message = 'A new update is available', data = self.getVersion())
self.last_check = time.time() self.last_check = time.time()

Loading…
Cancel
Save