diff --git a/htpc/updater.py b/htpc/updater.py index a43ffa32f..68911e5d1 100644 --- a/htpc/updater.py +++ b/htpc/updater.py @@ -29,7 +29,7 @@ def index(self): """ Handle server requests. Update on POST. Get status on GET. """ if self.git == '': self.logger.warning('Git not configured. Automatic update disabled.') - return -1 + return -1 if cherrypy.request.method.upper() == 'POST': Thread(target=self.git_update).start() return 1 @@ -87,8 +87,7 @@ def check_update(self): else: behind = self.behind_by(current, latest) self.logger.info("Currently " + str(behind) + " commits behind.") - return (behind, 'https://github.com/%s/%s/compare/%s...%s' % ( - self.user, self.repo, current, latest)) + return behind def git_update(self): """ Do update through git """ diff --git a/interfaces/default/js/default.js b/interfaces/default/js/default.js index 7f56d4b44..d5976c99c 100644 --- a/interfaces/default/js/default.js +++ b/interfaces/default/js/default.js @@ -42,8 +42,8 @@ $(document).ready(function () { $.getJSON(WEBDIR + 'update/', function (data) { if (data == 0) { notify('Update', 'Already running latest version.', 'success') - } else if ($.isNumeric(data[0] && data[0] > 0)) { - if (confirm('Your are '+data[0]+' versions behind. Update to latest version?')) { + } else if ($.isNumeric(data) && data > 0) { + if (confirm('Your are '+data+' versions behind. Update to latest version?')) { $.post(WEBDIR + 'update/', function (data) { if (data == 1) { showModal('Installing update', '
','')