diff --git a/couchpotato/core/_base/updater/main.py b/couchpotato/core/_base/updater/main.py index 944de8c..1774923 100644 --- a/couchpotato/core/_base/updater/main.py +++ b/couchpotato/core/_base/updater/main.py @@ -349,7 +349,13 @@ class DesktopUpdater(Plugin): self.desktop = Env.get('desktop') def doUpdate(self): - pass + try: + self.desktop.CheckForUpdate(silentUnlessUpdate = True) + except: + log.error('Failed updating desktop: %s' % traceback.format_exc()) + self.update_failed = True + + return False def info(self): return { @@ -360,12 +366,26 @@ class DesktopUpdater(Plugin): } def check(self): - self.desktop.CheckForUpdate(silentUnlessUpdate = True) + current_version = self.getVersion() + try: + latest = self.desktop._esky.find_update() + + if latest and latest != current_version.get('hash'): + self.update_version = { + 'hash': latest, + 'date': None, + 'changelog': self.desktop._changelogURL, + } + + self.last_check = time.time() + except: + log.error('Failed updating desktop: %s' % traceback.format_exc()) + + return self.update_version is not None def getVersion(self): return { 'hash': self.desktop._esky.active_version, - 'data': None, + 'date': None, 'type': 'desktop', } - diff --git a/couchpotato/core/_base/updater/static/updater.js b/couchpotato/core/_base/updater/static/updater.js index 899f879..bcbf48a 100644 --- a/couchpotato/core/_base/updater/static/updater.js +++ b/couchpotato/core/_base/updater/static/updater.js @@ -52,12 +52,16 @@ var UpdaterBase = new Class({ createMessage: function(data){ var self = this; + var changelog = 'https://github.com/'+data.repo_name+'/compare/'+data.version.hash+'...'+data.update_version.hash; + if(data.update_version.changelog) + changelog = data.update_version.changelog + '#' + data.version.hash+'...'+data.update_version.hash + self.message = new Element('div.message.update').adopt( new Element('span', { 'text': 'A new version is available' }), new Element('a', { - 'href': 'https://github.com/'+data.repo_name+'/compare/'+data.version.hash+'...'+data.update_version.hash, + 'href': changelog, 'text': 'see what has changed', 'target': '_blank' }), diff --git a/version.py b/version.py index a14b9d3..3808ef1 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -VERSION = '2.0.0-pre1' +VERSION = '2.0.0.pre1'