% if _session['user_group'] == 'admin':
- % if plexpy.CONFIG.CHECK_GITHUB and not plexpy.CURRENT_VERSION:
+ % if plexpy.CONFIG.CHECK_GITHUB and plexpy.UPDATE_AVAILABLE is None:
- % elif plexpy.CONFIG.CHECK_GITHUB and plexpy.COMMITS_BEHIND > 0 and plexpy.common.BRANCH in ('master', 'beta') and plexpy.common.RELEASE != plexpy.LATEST_RELEASE:
+ % elif plexpy.CONFIG.CHECK_GITHUB and plexpy.UPDATE_AVAILABLE == 'release':
- % elif plexpy.CONFIG.CHECK_GITHUB and plexpy.COMMITS_BEHIND > 0 and plexpy.CURRENT_VERSION != plexpy.LATEST_VERSION and plexpy.INSTALL_TYPE != 'win':
+ % elif plexpy.CONFIG.CHECK_GITHUB and plexpy.UPDATE_AVAILABLE == 'commit':
A
newer version of Tautulli is available!
@@ -140,7 +140,7 @@
Donate
% if plexpy.CONFIG.CHECK_GITHUB:
-
Check for Updates
+
Check for Updates
% endif
Restart
Shutdown
@@ -362,7 +362,7 @@ ${next.modalIncludes()}
$('#nav-update').click(function () {
$(this).html('
Checking');
- checkUpdate(function () { $('#nav-update').html('
Check for Updates'); });
+ checkUpdate(function () { $('#nav-update').html('
Check for Updates'); });
});
$('#donation_type a.crypto-donation').on('shown.bs.tab', function () {
diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html
index 2f6877f7..0a82c28f 100644
--- a/data/interfaces/default/settings.html
+++ b/data/interfaces/default/settings.html
@@ -33,7 +33,7 @@
% endif
% if config['check_github']:
-
+
% endif
@@ -1937,7 +1937,7 @@ $(document).ready(function() {
$('#menu_link_update_check').click(function() {
$(this).html('
Checking').prop('disabled', true);
checkUpdate(function () {
- $('#menu_link_update_check').html('
Check for Updates')
+ $('#menu_link_update_check').html('
Check for Updates')
.prop('disabled', false);
});
});
diff --git a/plexpy/__init__.py b/plexpy/__init__.py
index 21817603..1165f2a6 100644
--- a/plexpy/__init__.py
+++ b/plexpy/__init__.py
@@ -92,6 +92,7 @@ LATEST_VERSION = None
COMMITS_BEHIND = None
PREV_RELEASE = None
LATEST_RELEASE = None
+UPDATE_AVAILABLE = False
UMASK = None
@@ -259,7 +260,7 @@ def initialize(config_file):
# Check for new versions
if CONFIG.CHECK_GITHUB_ON_STARTUP and CONFIG.CHECK_GITHUB:
try:
- LATEST_VERSION = versioncheck.check_github()
+ LATEST_VERSION = versioncheck.check_update()
except:
logger.exception(u"Unhandled exception")
LATEST_VERSION = CURRENT_VERSION
@@ -421,7 +422,7 @@ def initialize_scheduler():
# Update check
github_minutes = CONFIG.CHECK_GITHUB_INTERVAL if CONFIG.CHECK_GITHUB_INTERVAL and CONFIG.CHECK_GITHUB else 0
- schedule_job(versioncheck.check_github, 'Check GitHub for updates',
+ schedule_job(versioncheck.check_update, 'Check GitHub for updates',
hours=0, minutes=github_minutes, seconds=0, args=(bool(CONFIG.PLEXPY_AUTO_UPDATE), True))
backup_hours = CONFIG.BACKUP_INTERVAL if 1 <= CONFIG.BACKUP_INTERVAL <= 24 else 6
diff --git a/plexpy/versioncheck.py b/plexpy/versioncheck.py
index 65734f94..52d19289 100644
--- a/plexpy/versioncheck.py
+++ b/plexpy/versioncheck.py
@@ -131,6 +131,21 @@ def getVersion():
return None, 'origin', common.BRANCH
+def check_update(auto_update=False, notify=False):
+ check_github(auto_update=auto_update, notify=notify)
+
+ if not plexpy.CURRENT_VERSION:
+ plexpy.UPDATE_AVAILABLE = None
+ elif plexpy.COMMITS_BEHIND > 0 and plexpy.common.BRANCH in ('master', 'beta') and \
+ plexpy.common.RELEASE != plexpy.LATEST_RELEASE:
+ plexpy.UPDATE_AVAILABLE = 'release'
+ elif plexpy.COMMITS_BEHIND > 0 and plexpy.CURRENT_VERSION != plexpy.LATEST_VERSION and \
+ plexpy.INSTALL_TYPE != 'win':
+ plexpy.UPDATE_AVAILABLE = 'commit'
+ else:
+ plexpy.UPDATE_AVAILABLE = False
+
+
def check_github(auto_update=False, notify=False):
plexpy.COMMITS_BEHIND = 0
diff --git a/plexpy/webserve.py b/plexpy/webserve.py
index 0bc661b9..029cf07b 100644
--- a/plexpy/webserve.py
+++ b/plexpy/webserve.py
@@ -3803,16 +3803,15 @@ class WebInterface(object):
}
```
"""
- versioncheck.check_github()
+ versioncheck.check_update()
- if not plexpy.CURRENT_VERSION:
+ if plexpy.UPDATE_AVAILABLE is None:
return {'result': 'error',
'update': None,
'message': 'You are running an unknown version of Tautulli.'
}
- elif plexpy.COMMITS_BEHIND > 0 and plexpy.common.BRANCH in ('master', 'beta') and \
- plexpy.common.RELEASE != plexpy.LATEST_RELEASE:
+ elif plexpy.UPDATE_AVAILABLE == 'release':
return {'result': 'success',
'update': True,
'release': True,
@@ -3825,8 +3824,7 @@ class WebInterface(object):
plexpy.LATEST_RELEASE))
}
- elif plexpy.COMMITS_BEHIND > 0 and plexpy.CURRENT_VERSION != plexpy.LATEST_VERSION and \
- plexpy.INSTALL_TYPE != 'win':
+ elif plexpy.UPDATE_AVAILABLE == 'commit':
return {'result': 'success',
'update': True,
'release': False,