mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-11 21:53:37 +00:00
Merge pull request #729 from adam111316/fix_zip_3
Third fix for zip updating and checkouts
This commit is contained in:
commit
c019ffef97
2 changed files with 12 additions and 5 deletions
|
@ -102,6 +102,7 @@ AUTO_UPDATE = False
|
||||||
NOTIFY_ON_UPDATE = False
|
NOTIFY_ON_UPDATE = False
|
||||||
CUR_COMMIT_HASH = None
|
CUR_COMMIT_HASH = None
|
||||||
BRANCH = ''
|
BRANCH = ''
|
||||||
|
CUR_COMMIT_BRANCH = ''
|
||||||
|
|
||||||
INIT_LOCK = Lock()
|
INIT_LOCK = Lock()
|
||||||
started = False
|
started = False
|
||||||
|
@ -444,7 +445,7 @@ __INITIALIZED__ = False
|
||||||
def initialize(consoleLogging=True):
|
def initialize(consoleLogging=True):
|
||||||
with INIT_LOCK:
|
with INIT_LOCK:
|
||||||
|
|
||||||
global BRANCH, CUR_COMMIT_HASH, ACTUAL_LOG_DIR, LOG_DIR, WEB_PORT, WEB_LOG, ENCRYPTION_VERSION, WEB_ROOT, WEB_USERNAME, WEB_PASSWORD, WEB_HOST, WEB_IPV6, USE_API, API_KEY, ENABLE_HTTPS, HTTPS_CERT, HTTPS_KEY, \
|
global BRANCH, CUR_COMMIT_HASH, CUR_COMMIT_BRANCH, ACTUAL_LOG_DIR, LOG_DIR, WEB_PORT, WEB_LOG, ENCRYPTION_VERSION, WEB_ROOT, WEB_USERNAME, WEB_PASSWORD, WEB_HOST, WEB_IPV6, USE_API, API_KEY, ENABLE_HTTPS, HTTPS_CERT, HTTPS_KEY, \
|
||||||
HANDLE_REVERSE_PROXY, USE_NZBS, USE_TORRENTS, NZB_METHOD, NZB_DIR, DOWNLOAD_PROPERS, CHECK_PROPERS_INTERVAL, ALLOW_HIGH_PRIORITY, TORRENT_METHOD, \
|
HANDLE_REVERSE_PROXY, USE_NZBS, USE_TORRENTS, NZB_METHOD, NZB_DIR, DOWNLOAD_PROPERS, CHECK_PROPERS_INTERVAL, ALLOW_HIGH_PRIORITY, TORRENT_METHOD, \
|
||||||
SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \
|
SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \
|
||||||
NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_PRIORITY, NZBGET_HOST, NZBGET_USE_HTTPS, backlogSearchScheduler, \
|
NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_PRIORITY, NZBGET_HOST, NZBGET_USE_HTTPS, backlogSearchScheduler, \
|
||||||
|
@ -511,13 +512,17 @@ def initialize(consoleLogging=True):
|
||||||
CheckSection(CFG, 'Pushbullet')
|
CheckSection(CFG, 'Pushbullet')
|
||||||
CheckSection(CFG, 'Subtitles')
|
CheckSection(CFG, 'Subtitles')
|
||||||
|
|
||||||
# branch
|
# wanted branch
|
||||||
BRANCH = check_setting_str(CFG, 'General', 'branch', '')
|
BRANCH = check_setting_str(CFG, 'General', 'branch', '')
|
||||||
|
|
||||||
# current commit hash
|
# current commit hash
|
||||||
CUR_COMMIT_HASH = check_setting_str(CFG, 'General', 'cur_commit_hash', '')
|
CUR_COMMIT_HASH = check_setting_str(CFG, 'General', 'cur_commit_hash', '')
|
||||||
|
|
||||||
|
# current commit branch
|
||||||
|
CUR_COMMIT_BRANCH = check_setting_str(CFG, 'General', 'cur_commit_branch', '')
|
||||||
|
|
||||||
ACTUAL_CACHE_DIR = check_setting_str(CFG, 'General', 'cache_dir', 'cache')
|
ACTUAL_CACHE_DIR = check_setting_str(CFG, 'General', 'cache_dir', 'cache')
|
||||||
|
|
||||||
# fix bad configs due to buggy code
|
# fix bad configs due to buggy code
|
||||||
if ACTUAL_CACHE_DIR == 'None':
|
if ACTUAL_CACHE_DIR == 'None':
|
||||||
ACTUAL_CACHE_DIR = 'cache'
|
ACTUAL_CACHE_DIR = 'cache'
|
||||||
|
@ -1310,6 +1315,7 @@ def save_config():
|
||||||
new_config['General'] = {}
|
new_config['General'] = {}
|
||||||
new_config['General']['branch'] = BRANCH
|
new_config['General']['branch'] = BRANCH
|
||||||
new_config['General']['cur_commit_hash'] = CUR_COMMIT_HASH
|
new_config['General']['cur_commit_hash'] = CUR_COMMIT_HASH
|
||||||
|
new_config['General']['cur_commit_branch'] = CUR_COMMIT_BRANCH
|
||||||
new_config['General']['config_version'] = CONFIG_VERSION
|
new_config['General']['config_version'] = CONFIG_VERSION
|
||||||
new_config['General']['encryption_version'] = int(ENCRYPTION_VERSION)
|
new_config['General']['encryption_version'] = int(ENCRYPTION_VERSION)
|
||||||
new_config['General']['log_dir'] = ACTUAL_LOG_DIR if ACTUAL_LOG_DIR else 'Logs'
|
new_config['General']['log_dir'] = ACTUAL_LOG_DIR if ACTUAL_LOG_DIR else 'Logs'
|
||||||
|
|
|
@ -571,10 +571,10 @@ class SourceUpdateManager(UpdateManager):
|
||||||
self._num_commits_behind = 0
|
self._num_commits_behind = 0
|
||||||
|
|
||||||
def _find_installed_branch(self):
|
def _find_installed_branch(self):
|
||||||
if sickbeard.BRANCH == "":
|
if sickbeard.CUR_COMMIT_BRANCH == "":
|
||||||
return "master"
|
return "master"
|
||||||
|
else:
|
||||||
return ""
|
return sickbeard.CUR_COMMIT_BRANCH
|
||||||
|
|
||||||
def need_update(self):
|
def need_update(self):
|
||||||
# need this to run first to set self._newest_commit_hash
|
# need this to run first to set self._newest_commit_hash
|
||||||
|
@ -738,6 +738,7 @@ class SourceUpdateManager(UpdateManager):
|
||||||
os.renames(old_path, new_path)
|
os.renames(old_path, new_path)
|
||||||
|
|
||||||
sickbeard.CUR_COMMIT_HASH = self._newest_commit_hash
|
sickbeard.CUR_COMMIT_HASH = self._newest_commit_hash
|
||||||
|
sickbeard.CUR_COMMIT_BRANCH = self.branch
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.log(u"Error while trying to update: " + ex(e), logger.ERROR)
|
logger.log(u"Error while trying to update: " + ex(e), logger.ERROR)
|
||||||
|
|
Loading…
Reference in a new issue