Refactor update check

This commit is contained in:
JonnyWong16 2018-08-14 19:23:20 -07:00
parent 4f4a66f7e7
commit 13dac9c1ea
5 changed files with 29 additions and 15 deletions

View file

@ -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,