Skip to content

Commit e212aaa

Browse files
committed
Issue #2 - updater js fix
1 parent bd59f3a commit e212aaa

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

htpc/updater.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def index(self):
2929
""" Handle server requests. Update on POST. Get status on GET. """
3030
if self.git == '':
3131
self.logger.warning('Git not configured. Automatic update disabled.')
32-
return -1
32+
return -1
3333
if cherrypy.request.method.upper() == 'POST':
3434
Thread(target=self.git_update).start()
3535
return 1
@@ -87,8 +87,7 @@ def check_update(self):
8787
else:
8888
behind = self.behind_by(current, latest)
8989
self.logger.info("Currently " + str(behind) + " commits behind.")
90-
return (behind, 'https://github.com/%s/%s/compare/%s...%s' % (
91-
self.user, self.repo, current, latest))
90+
return behind
9291

9392
def git_update(self):
9493
""" Do update through git """

interfaces/default/js/default.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ $(document).ready(function () {
4242
$.getJSON(WEBDIR + 'update/', function (data) {
4343
if (data == 0) {
4444
notify('Update', 'Already running latest version.', 'success')
45-
} else if ($.isNumeric(data[0] && data[0] > 0)) {
46-
if (confirm('Your are '+data[0]+' versions behind. Update to latest version?')) {
45+
} else if ($.isNumeric(data) && data > 0) {
46+
if (confirm('Your are '+data+' versions behind. Update to latest version?')) {
4747
$.post(WEBDIR + 'update/', function (data) {
4848
if (data == 1) {
4949
showModal('Installing update', '<div class="progress progress-striped active"><div class="bar" style="width:100%"></div></div>','')

0 commit comments

Comments
 (0)