Browse Source

Merge branch 'refs/heads/develop'

pull/381/merge
Ruud 13 years ago
parent
commit
f2f524c4e4
  1. 28
      couchpotato/core/_base/updater/main.py
  2. 6
      couchpotato/core/_base/updater/static/updater.js
  3. 2
      version.py

28
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',
}

6
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'
}),

2
version.py

@ -1 +1 @@
VERSION = '2.0.0-pre1'
VERSION = '2.0.0.pre1'

Loading…
Cancel
Save