mirror of
https://github.com/SickGear/SickGear.git
synced 2024-11-15 01:15:05 +00:00
Merge branch 'hotfix/3.32.7'
This commit is contained in:
commit
fcf5ccf236
6 changed files with 41 additions and 11 deletions
|
@ -1,4 +1,10 @@
|
||||||
### 3.32.6 (2024-08-12 17:10:00 UTC)
|
### 3.32.7 (2024-08-13 11:30:00 UTC)
|
||||||
|
|
||||||
|
* Change to prevent saving config.ini before it's fully loaded
|
||||||
|
* Change login form to be more password manager friendly
|
||||||
|
|
||||||
|
|
||||||
|
### 3.32.6 (2024-08-12 17:10:00 UTC)
|
||||||
|
|
||||||
* Fix saving config.ini after restart and startup
|
* Fix saving config.ini after restart and startup
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body><div class="login"><form action="" method="post">$xsrf_form_html<div class="login-img center-block form-group"></div>
|
<body><div class="login"><form action="" method="post">$xsrf_form_html<div class="login-img center-block form-group"></div>
|
||||||
<div class="login-error"><div class="#if 'authfailed'==$resp then 'showme' else 'hide' #"><i class="error16"></i><span class="red-text">Authentication failed, please retry</span></div></div>
|
<div class="login-error"><div class="#if 'authfailed'==$resp then 'showme' else 'hide' #"><i class="error16"></i><span class="red-text">Authentication failed, please retry</span></div></div>
|
||||||
<div class="form-group input-group"><span class="input-group-addon"><i class="icons icons-user" style=""></i></span><input name="username" class="form-control" placeholder="Username" type="text" autofocus></div>
|
<div class="form-group input-group"><span class="input-group-addon"><i class="icons icons-user" style=""></i></span><input name="username" class="form-control" placeholder="Username" type="text" autocomplete="username" autofocus></div>
|
||||||
<div class="form-group input-group"><span class="input-group-addon"><i class="icons icons-lock" style=""></i></span><input name="password" class="form-control" placeholder="Password" type="password"></div>
|
<div class="form-group input-group"><span class="input-group-addon"><i class="icons icons-lock" style=""></i></span><input name="password" class="form-control" placeholder="Password" type="password" autocomplete="current-password"></div>
|
||||||
<div class="form-group"><label for="remember_me" class="login-remember"><input id="remember_me" name="remember_me" type="checkbox" value="1" checked="checked"><span>Remember me</span></label><input class="btn pull-right" name="submit" type="submit" value="Login"></div>
|
<div class="form-group"><label for="remember_me" class="login-remember"><input id="remember_me" name="remember_me" type="checkbox" value="1" checked="checked"><span>Remember me</span></label><input class="btn pull-right" name="submit" type="submit" value="Login"></div>
|
||||||
</form></div></body></html>
|
</form></div></body></html>
|
||||||
|
|
|
@ -76,6 +76,7 @@ CFG = None # type: ConfigObj
|
||||||
CONFIG_FILE = ''
|
CONFIG_FILE = ''
|
||||||
CONFIG_VERSION = None
|
CONFIG_VERSION = None
|
||||||
CONFIG_OLD = None
|
CONFIG_OLD = None
|
||||||
|
CONFIG_LOADED = False
|
||||||
|
|
||||||
# Default encryption version (0 for None)
|
# Default encryption version (0 for None)
|
||||||
ENCRYPTION_VERSION = 0
|
ENCRYPTION_VERSION = 0
|
||||||
|
@ -671,7 +672,7 @@ def init_stage_1(console_logging):
|
||||||
WEB_HOST, WEB_ROOT, ACTUAL_CACHE_DIR, CACHE_DIR, ZONEINFO_DIR, ADD_SHOWS_WO_DIR, ADD_SHOWS_METALANG, \
|
WEB_HOST, WEB_ROOT, ACTUAL_CACHE_DIR, CACHE_DIR, ZONEINFO_DIR, ADD_SHOWS_WO_DIR, ADD_SHOWS_METALANG, \
|
||||||
CREATE_MISSING_SHOW_DIRS, SHOW_DIRS_WITH_DOTS, \
|
CREATE_MISSING_SHOW_DIRS, SHOW_DIRS_WITH_DOTS, \
|
||||||
RECENTSEARCH_STARTUP, NAMING_FORCE_FOLDERS, SOCKET_TIMEOUT, DEBUG, TVINFO_DEFAULT, \
|
RECENTSEARCH_STARTUP, NAMING_FORCE_FOLDERS, SOCKET_TIMEOUT, DEBUG, TVINFO_DEFAULT, \
|
||||||
CONFIG_FILE, CONFIG_VERSION, CONFIG_OLD, \
|
CONFIG_FILE, CONFIG_VERSION, CONFIG_OLD, CONFIG_LOADED, \
|
||||||
REMOVE_FILENAME_CHARS, IMPORT_DEFAULT_CHECKED_SHOWS, WANTEDLIST_CACHE, MODULE_UPDATE_STRING, EXT_UPDATES
|
REMOVE_FILENAME_CHARS, IMPORT_DEFAULT_CHECKED_SHOWS, WANTEDLIST_CACHE, MODULE_UPDATE_STRING, EXT_UPDATES
|
||||||
# Add Show Search
|
# Add Show Search
|
||||||
global RESULTS_SORTBY
|
global RESULTS_SORTBY
|
||||||
|
@ -1479,6 +1480,7 @@ def init_stage_1(console_logging):
|
||||||
header = callable(getattr(cur_provider, '_init_api', False)) and False is cur_provider._init_api() \
|
header = callable(getattr(cur_provider, '_init_api', False)) and False is cur_provider._init_api() \
|
||||||
and header or {}
|
and header or {}
|
||||||
cur_provider.headers.update(header)
|
cur_provider.headers.update(header)
|
||||||
|
update_config |= cur_provider.should_save_config()
|
||||||
|
|
||||||
# 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', '')
|
||||||
|
@ -1510,6 +1512,10 @@ def init_stage_1(console_logging):
|
||||||
|
|
||||||
# Get expected config version
|
# Get expected config version
|
||||||
CONFIG_VERSION = max(ConfigMigrator(CFG).migration_names)
|
CONFIG_VERSION = max(ConfigMigrator(CFG).migration_names)
|
||||||
|
|
||||||
|
# we have fully loaded all config settings into vars
|
||||||
|
CONFIG_LOADED = True
|
||||||
|
|
||||||
if update_config:
|
if update_config:
|
||||||
_save_config(force=True)
|
_save_config(force=True)
|
||||||
|
|
||||||
|
@ -1896,7 +1902,9 @@ def save_config(force=False):
|
||||||
|
|
||||||
:param force: force save config even if unchanged
|
:param force: force save config even if unchanged
|
||||||
"""
|
"""
|
||||||
global config_events
|
global config_events, CONFIG_LOADED
|
||||||
|
if not CONFIG_LOADED:
|
||||||
|
return
|
||||||
|
|
||||||
# use queue if it's available, otherwise, call save_config directly
|
# use queue if it's available, otherwise, call save_config directly
|
||||||
hasattr(config_events, 'put') and config_events.put(force) or _save_config(force)
|
hasattr(config_events, 'put') and config_events.put(force) or _save_config(force)
|
||||||
|
@ -1904,7 +1912,10 @@ def save_config(force=False):
|
||||||
|
|
||||||
def _save_config(force=False, **kwargs):
|
def _save_config(force=False, **kwargs):
|
||||||
# type: (bool, ...) -> None
|
# type: (bool, ...) -> None
|
||||||
global CONFIG_OLD
|
global CONFIG_OLD, CONFIG_LOADED
|
||||||
|
if not CONFIG_LOADED:
|
||||||
|
return
|
||||||
|
|
||||||
new_config = ConfigObj()
|
new_config = ConfigObj()
|
||||||
new_config.filename = CONFIG_FILE
|
new_config.filename = CONFIG_FILE
|
||||||
|
|
||||||
|
|
|
@ -275,6 +275,19 @@ class GenericProvider(object):
|
||||||
self.scene_rej_nuked = False # type: bool
|
self.scene_rej_nuked = False # type: bool
|
||||||
self.scene_nuked_active = False # type: bool
|
self.scene_nuked_active = False # type: bool
|
||||||
|
|
||||||
|
self._save_config = False # type: bool
|
||||||
|
|
||||||
|
|
||||||
|
def save_main_config(self):
|
||||||
|
self._save_config = True
|
||||||
|
sickgear.save_config()
|
||||||
|
|
||||||
|
def should_save_config(self):
|
||||||
|
# type: (...) -> bool
|
||||||
|
_s_c = self._save_config
|
||||||
|
self._save_config = False
|
||||||
|
return _s_c
|
||||||
|
|
||||||
def _load_fail_values(self):
|
def _load_fail_values(self):
|
||||||
if hasattr(sickgear, 'DATA_DIR'):
|
if hasattr(sickgear, 'DATA_DIR'):
|
||||||
my_db = db.DBConnection('cache.db')
|
my_db = db.DBConnection('cache.db')
|
||||||
|
@ -1957,7 +1970,7 @@ class TorrentProvider(GenericProvider):
|
||||||
|
|
||||||
if last_url != cur_url or (expire and not (expire > int(time.time()))):
|
if last_url != cur_url or (expire and not (expire > int(time.time()))):
|
||||||
sickgear.PROVIDER_HOMES[self.get_id()] = (cur_url, int(time.time()) + (60*60))
|
sickgear.PROVIDER_HOMES[self.get_id()] = (cur_url, int(time.time()) + (60*60))
|
||||||
sickgear.save_config()
|
self.save_main_config()
|
||||||
return cur_url
|
return cur_url
|
||||||
|
|
||||||
seen_attr = 'PROVIDER_SEEN'
|
seen_attr = 'PROVIDER_SEEN'
|
||||||
|
@ -1975,7 +1988,7 @@ class TorrentProvider(GenericProvider):
|
||||||
if not hasattr(self, 'url_api'):
|
if not hasattr(self, 'url_api'):
|
||||||
self.urls = {}
|
self.urls = {}
|
||||||
sickgear.PROVIDER_HOMES[self.get_id()] = ('site down', int(time.time()) + (5 * 60))
|
sickgear.PROVIDER_HOMES[self.get_id()] = ('site down', int(time.time()) + (5 * 60))
|
||||||
sickgear.save_config()
|
self.save_main_config()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def is_valid_mod(self, url):
|
def is_valid_mod(self, url):
|
||||||
|
@ -2088,7 +2101,7 @@ class TorrentProvider(GenericProvider):
|
||||||
|
|
||||||
if maxed_out(response) and hasattr(self, 'password'):
|
if maxed_out(response) and hasattr(self, 'password'):
|
||||||
self.password = None
|
self.password = None
|
||||||
sickgear.save_config()
|
self.save_main_config()
|
||||||
msg = failed_msg(response)
|
msg = failed_msg(response)
|
||||||
if msg:
|
if msg:
|
||||||
logger.error(msg % self.name)
|
logger.error(msg % self.name)
|
||||||
|
|
|
@ -56,7 +56,7 @@ class ImmortalSeedProvider(generic.TorrentProvider):
|
||||||
|
|
||||||
if secret_key != self.api_key:
|
if secret_key != self.api_key:
|
||||||
self.api_key = secret_key
|
self.api_key = secret_key
|
||||||
sickgear.save_config()
|
self.save_main_config()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ class SpeedCDProvider(generic.TorrentProvider):
|
||||||
self.digest = None
|
self.digest = None
|
||||||
if self.session.cookies.get('inSpeed_speedian'):
|
if self.session.cookies.get('inSpeed_speedian'):
|
||||||
self.digest = 'inSpeed_speedian=%s' % self.session.cookies.get('inSpeed_speedian')
|
self.digest = 'inSpeed_speedian=%s' % self.session.cookies.get('inSpeed_speedian')
|
||||||
sickgear.save_config()
|
self.save_main_config()
|
||||||
result = True
|
result = True
|
||||||
logger.debug('Cookie details for %s updated.' % self.name)
|
logger.debug('Cookie details for %s updated.' % self.name)
|
||||||
elif not self.failure_count:
|
elif not self.failure_count:
|
||||||
|
|
Loading…
Reference in a new issue