Change only update enabled torrent providers.

Change prevent browser auto completing password fields on config pages.
Fix restart when switching from master to develop.
This commit is contained in:
JackDandy 2016-11-19 03:19:57 +00:00
parent 266a512876
commit bcae0cf1b8
10 changed files with 75 additions and 76 deletions

View file

@ -195,6 +195,7 @@
* Change consolidate shutdown with restart, improve systemd support, bring order to on-init globals
* Change speed improvement in finding needed categories/qualities (sd, hd, uhd)
* Change add guidance when using the "unknown" quality selection
* Change prevent browser auto completing password fields on config pages
[develop changelog]
* Change send nzb data to NZBGet for Anizb instead of url
@ -234,6 +235,8 @@
* Fix launch browser during startup
* Change don't exclude "unknown" from search
* Fix UHD category select in Recent Search
* Change only update enabled torrent providers
* Fix restart when switching from master to develop
### 0.11.16 (2016-10-16 17:30:00 UTC)

View file

@ -83,7 +83,7 @@
<label for="anidb_password">
<span class="component-title">AniDB password</span>
<span class="component-desc">
<input type="password" name="anidb_password" id="anidb_password" value="#echo '*' * len($sickbeard.ANIDB_PASSWORD)#" class="form-control input-sm input350" />
<input type="password" autocomplete="nope" name="anidb_password" id="anidb_password" value="#echo '*' * len($sickbeard.ANIDB_PASSWORD)#" class="form-control input-sm input350">
</span>
</label>
</div>
@ -113,4 +113,4 @@
</div>
</div>
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')

View file

@ -433,7 +433,7 @@
<label for="web_password">
<span class="component-title">Password</span>
<span class="component-desc">
<input type="password" name="web_password" id="web_password" value="#echo '*' * len($sickbeard.WEB_PASSWORD)#" class="form-control input-sm input300">
<input type="password" autocomplete="nope" name="web_password" id="web_password" value="#echo '*' * len($sickbeard.WEB_PASSWORD)#" class="form-control input-sm input300">
<p>blank for none</p>
<span class="clear-left">check autoProcessTV.cfg is set up for external apps to use post processing scripts</span>
</span>

View file

@ -163,7 +163,7 @@
<label for="kodi_password">
<span class="component-title">Kodi web server password</span>
<span class="component-desc">
<input type="password" name="kodi_password" id="kodi_password" value="#echo '*' * len($sickbeard.KODI_PASSWORD)#" class="form-control input-sm input250" />
<input type="password" autocomplete="nope" name="kodi_password" id="kodi_password" value="#echo '*' * len($sickbeard.KODI_PASSWORD)#" class="form-control input-sm input250">
<p>(blank for none)</p>
<div class="clear-left"><p>in Kodi System/Settings/Services/Web server</p></div>
</span>
@ -312,7 +312,7 @@
<div class="field-pair">
<label for="xbmc_password">
<span class="component-title">XBMC password</span>
<input type="password" name="xbmc_password" id="xbmc_password" value="#echo '*' * len($sickbeard.XBMC_PASSWORD)#" class="form-control input-sm input250" />
<input type="password" autocomplete="nope" name="xbmc_password" id="xbmc_password" value="#echo '*' * len($sickbeard.XBMC_PASSWORD)#" class="form-control input-sm input250">
</label>
<label>
<span class="component-title">&nbsp;</span>
@ -361,7 +361,7 @@
<label for="plex_password">
<span class="component-title">Server/client password</span>
<span class="component-desc">
<input type="password" name="plex_password" id="plex_password" value="#echo '*' * len($sickbeard.PLEX_PASSWORD)#" class="form-control input-sm input250" />
<input type="password" autocomplete="nope" name="plex_password" id="plex_password" value="#echo '*' * len($sickbeard.PLEX_PASSWORD)#" class="form-control input-sm input250">
<p>blank = no authentication</p>
</span>
</label>
@ -812,7 +812,7 @@
<div class="field-pair">
<label for="growl_password">
<span class="component-title">Growl password</span>
<input type="password" name="growl_password" id="growl_password" value="#echo '*' * len($sickbeard.GROWL_PASSWORD)#" class="form-control input-sm input250" />
<input type="password" autocomplete="nope" name="growl_password" id="growl_password" value="#echo '*' * len($sickbeard.GROWL_PASSWORD)#" class="form-control input-sm input250">
</label>
<label>
<span class="component-title">&nbsp;</span>
@ -1759,7 +1759,7 @@
<label for="email_password">
<span class="component-title">SMTP server password</span>
<span class="component-desc">
<input type="password" name="email_password" id="email_password" value="#echo '*' * len($sickbeard.EMAIL_PASSWORD)#" class="form-control input-sm input250" />
<input type="password" autocomplete="nope" name="email_password" id="email_password" value="#echo '*' * len($sickbeard.EMAIL_PASSWORD)#" class="form-control input-sm input250">
<p>(optional)</p>
</span>
</label>

View file

@ -432,7 +432,7 @@
<label for="${cur_torrent_provider.get_id()}_password">
<span class="component-title">Password:</span>
<span class="component-desc">
<input type="password" name="${cur_torrent_provider.get_id()}_password" id="${cur_torrent_provider.get_id()}_password" value="#echo $cur_torrent_provider.password and '*' * len($cur_torrent_provider.password) or ''#" class="form-control input-sm input350" />
<input type="password" autocomplete="nope" name="${cur_torrent_provider.get_id()}_password" id="${cur_torrent_provider.get_id()}_password" value="#echo $cur_torrent_provider.password and '*' * len($cur_torrent_provider.password) or ''#" class="form-control input-sm input350">
</span>
</label>
</div>

View file

@ -280,7 +280,7 @@
<label>
<span class="component-title">SABnzbd password</span>
<span class="component-desc">
<input type="password" name="sab_password" id="sab_password" value="#echo '*' * len($sickbeard.SAB_PASSWORD)#" class="form-control input-sm input200">
<input type="password" autocomplete="nope" name="sab_password" id="sab_password" value="#echo '*' * len($sickbeard.SAB_PASSWORD)#" class="form-control input-sm input200">
<p>(blank for none)</p>
</span>
</label>
@ -344,7 +344,7 @@
<label>
<span class="component-title">NZBget password</span>
<span class="component-desc">
<input type="password" name="nzbget_password" id="nzbget_password" value="#echo '*' * len($sickbeard.NZBGET_PASSWORD)#" class="form-control input-sm input200">
<input type="password" autocomplete="nope" name="nzbget_password" id="nzbget_password" value="#echo '*' * len($sickbeard.NZBGET_PASSWORD)#" class="form-control input-sm input200">
<p>locate in nzbget.conf (default:tegbzn6789)</p>
</span>
</label>
@ -499,7 +499,7 @@
<label>
<span class="component-title" id="password-title">Client password</span>
<span class="component-desc">
<input type="password" name="torrent_password" id="torrent_password" value="#echo '*' * len($sickbeard.TORRENT_PASSWORD)#" class="form-control input-sm input200">
<input type="password" autocomplete="nope" name="torrent_password" id="torrent_password" value="#echo '*' * len($sickbeard.TORRENT_PASSWORD)#" class="form-control input-sm input200">
<p>(blank for none)</p>
</span>
</label>

View file

@ -1,9 +1,12 @@
##
#set sgHost = $sbHost
#set sgPort = $sbHttpPort
#set sgRoot = $sbRoot
#set sgUseHttps = $sbHttpsEnabled
#set themeSpinner = '-dark' if 'dark' == $sbThemeName else ''
#from sickbeard import WEB_PORT, WEB_ROOT, PID, ENABLE_HTTPS, THEME_NAME
#set sg_host = $getVar('sbHost', 'localhost')
#set sg_port = str($getVar('sbHttpPort', WEB_PORT))
#set sg_root = $getVar('sbRoot', WEB_ROOT)
#set sg_pid = $getVar('sbPID', str(PID))
#set sg_use_https = $getVar('sbHttpsEnabled', ENABLE_HTTPS)
#set theme_suffix = ('', '-dark')['dark' == $getVar('sbThemeName', THEME_NAME)]
#set do_shutdown = bool($getVar('shutdown', False)) ## can be None so must enforce bool
##
<!DOCTYPE html>
<head>
@ -13,50 +16,50 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>SickGear - Restarting</title>
<link rel="shortcut icon" href="$sbRoot/images/ico/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="$sbRoot/images/ico/apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="152x152" href="$sbRoot/images/ico/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="144x144" href="$sbRoot/images/ico/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="120x120" href="$sbRoot/images/ico/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="114x114" href="$sbRoot/images/ico/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="76x76" href="$sbRoot/images/ico/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="72x72" href="$sbRoot/images/ico/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="60x60" href="$sbRoot/images/ico/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="57x57" href="$sbRoot/images/ico/apple-touch-icon-57x57.png">
<link rel="icon" type="image/png" href="$sbRoot/images/ico/favicon-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="$sbRoot/images/ico/favicon-160x160.png" sizes="160x160">
<link rel="icon" type="image/png" href="$sbRoot/images/ico/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="$sbRoot/images/ico/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="$sbRoot/images/ico/favicon-16x16.png" sizes="16x16">
<link rel="shortcut icon" href="$sg_root/images/ico/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="$sg_root/images/ico/apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="152x152" href="$sg_root/images/ico/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="144x144" href="$sg_root/images/ico/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="120x120" href="$sg_root/images/ico/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="114x114" href="$sg_root/images/ico/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="76x76" href="$sg_root/images/ico/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="72x72" href="$sg_root/images/ico/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="60x60" href="$sg_root/images/ico/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="57x57" href="$sg_root/images/ico/apple-touch-icon-57x57.png">
<link rel="icon" type="image/png" href="$sg_root/images/ico/favicon-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="$sg_root/images/ico/favicon-160x160.png" sizes="160x160">
<link rel="icon" type="image/png" href="$sg_root/images/ico/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="$sg_root/images/ico/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="$sg_root/images/ico/favicon-16x16.png" sizes="16x16">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-TileImage" content="$sbRoot/images/ico/mstile-144x144.png">
<meta name="msapplication-config" content="$sbRoot/css/browserconfig.xml">
<meta name="msapplication-TileImage" content="$sg_root/images/ico/mstile-144x144.png">
<meta name="msapplication-config" content="$sg_root/css/browserconfig.xml">
<script type="text/javascript" src="$sbRoot/js/lib/jquery-1.8.3.min.js?v=$sbPID"></script>
<script type="text/javascript" src="$sg_root/js/lib/jquery-1.8.3.min.js?v=$sg_pid"></script>
<script type="text/javascript" charset="utf-8">
<!--
\$.SickGear = {
Host: '$sgHost',
Port: '$sgPort',
Root: '$sgRoot',
UseHttps: #echo ('!1', '!0')[False != $sgUseHttps and 0 != $sgUseHttps]#
Host: '$sg_host',
Port: '$sg_port',
Root: '$sg_root',
UseHttps: #echo ('!1', '!0')[False != $sg_use_https and 0 != $sg_use_https]#
};
//-->
</script>
<script type="text/javascript" src="$sbRoot/js/restart.js?v=$sbPID"></script>
<script type="text/javascript" src="$sg_root/js/restart.js?v=$sg_pid"></script>
<style>
body{padding-top:0 !important}.sglogo{display:block;width:138px;height:74px;margin-bottom:-10px;background:url(${sbRoot}/images/sickgear.png) no-repeat 0 0}.bfr{position:absolute;left:-999px;top:-999px}.bfr img{width:16px;height:16px}.spinner{display:inline-block;width:16px;height:16px;background:url(${sbRoot}/images/loading16${themeSpinner}.gif) no-repeat 0 0}.sub-title{padding-bottom:10px}.desc, .images i{margin-right:6px}.images i{vertical-align:middle}.hide,.hide-yes,.hide-no{display:none}#restart_fail_message{padding-top:10px}
body{padding-top:0 !important}.sglogo{display:block;width:138px;height:74px;margin-bottom:-10px;background:url(${sg_root}/images/sickgear.png) no-repeat 0 0}.bfr{position:absolute;left:-999px;top:-999px}.bfr img{width:16px;height:16px}.spinner{display:inline-block;width:16px;height:16px;background:url(${sg_root}/images/loading16${theme_suffix}.gif) no-repeat 0 0}.sub-title{padding-bottom:10px}.desc, .images i{margin-right:6px}.images i{vertical-align:middle}.hide,.hide-yes,.hide-no{display:none}#restart_fail_message{padding-top:10px}
</style>
<link rel="stylesheet" type="text/css" href="$sbRoot/css/style.css?v=$sbPID">
<link rel="stylesheet" type="text/css" href="$sbRoot/css/#echo ('dark', 'light')['' == $themeSpinner]#.css?v=$sbPID">
<link rel="stylesheet" type="text/css" href="$sg_root/css/style.css?v=$sg_pid">
<link rel="stylesheet" type="text/css" href="$sg_root/css/#echo ('dark', 'light')['' == $theme_suffix]#.css?v=$sg_pid">
</head><body><span class="sglogo"></span>
<div class="bfr"><img src="$sbRoot/images/loading16${themeSpinner}.gif" /><img src="$sbRoot/images/yes16.png" /><img src="$sbRoot/images/no16.png" /></div>
<div class="bfr"><img src="$sg_root/images/loading16${theme_suffix}.gif" /><img src="$sg_root/images/yes16.png" /><img src="$sg_root/images/no16.png" /></div>
<h2 class="sub-title">Performing #echo ('Restart', 'Shutdown')[$shutdown]#</h2>
<h2 class="sub-title">Performing #echo ('Restart', 'Shutdown')[$do_shutdown]#</h2>
<div id="shut_down_message">
<span class="desc"><span class="grey-text">Waiting for SickGear to</span> shut down: </span>
@ -64,21 +67,21 @@ body{padding-top:0 !important}.sglogo{display:block;width:138px;height:74px;marg
</div>
<div class="hide" id="restart_message">
#if not $shutdown
#if not $do_shutdown
<span class="desc"><span class="grey-text">Waiting for SickGear to</span> start up: </span>
<span class="images"><i class="spinner"></i><span class="hide-yes"><i class="yes"></i></span><span class="hide-no"><i class="no"></i></span></span>
#end if
</div>
<div class="hide" id="refresh_message">
#if not $shutdown
#if not $do_shutdown
<span class="desc"><span class="grey-text">Waiting for SickGear </span> home page: </span>
<span class="images"><i class="spinner"></i></span>
#end if
</div>
<div class="hide" id="restart_fail_message">
#if not $shutdown
#if not $do_shutdown
<span class="red-text">Error:</span> The restart timed out, perhaps something prevented SickGear from starting ?
#end if
</div>

View file

@ -299,10 +299,9 @@ class TimedCompressedRotatingFileHandler(TimedRotatingFileHandler):
@staticmethod
def delete_logfile(filepath):
from sickbeard import encodingKludge
if encodingKludge.ek(os.path.exists, filepath):
if os.path.exists(filepath):
if sickbeard.TRASH_ROTATE_LOGS:
encodingKludge.ek(send2trash, filepath)
send2trash(filepath)
else:
sickbeard.helpers.remove_file_failed(filepath)

View file

@ -952,13 +952,16 @@ class TorrentProvider(object, GenericProvider):
url_list = ['%s/' % x.rstrip('/') for x in url_list]
last_url, expire = sickbeard.PROVIDER_HOMES.get(self.get_id(), ('', None))
if 'site down' == last_url:
if expire and (expire > int(time.time())):
if expire and (expire > int(time.time())) or not self.enabled:
return None
elif last_url:
last_url = last_url.replace('getrss.php', '/') # correct develop typo after a network outage (0.11>0.12)
last_url in url_list and url_list.remove(last_url)
url_list.insert(0, last_url)
if not self.enabled:
return last_url
for cur_url in url_list:
if not self.is_valid_mod(cur_url):
return None

View file

@ -76,35 +76,22 @@ except ImportError:
class PageTemplate(Template):
def __init__(self, headers, *args, **KWs):
KWs['file'] = os.path.join(sickbeard.PROG_DIR, 'gui/' + sickbeard.GUI_NAME + '/interfaces/default/',
KWs['file'])
super(PageTemplate, self).__init__(*args, **KWs)
def __init__(self, headers, *args, **kwargs):
self.sbRoot = sickbeard.WEB_ROOT
self.sbHost = (re.match('(?msx)^' + (('[^:]+', '\[.*\]')['[' == headers['Host'][0]]), headers['Host']).group(0),
headers.get('X-Forwarded-Host', ''))['X-Forwarded-Host' in headers]
self.sbHttpPort = sickbeard.WEB_PORT
self.sbHttpsPort = sickbeard.WEB_PORT
self.sbHttpsEnabled = sickbeard.ENABLE_HTTPS
self.sbHttpsPort = (self.sbHttpPort, headers.get('X-Forwarded-Port', ''))['X-Forwarded-Port' in headers]
self.sbRoot = sickbeard.WEB_ROOT
self.sbHttpsEnabled = (sickbeard.ENABLE_HTTPS, 'https' == headers.get('X-Forwarded-Proto', ''))[
'X-Forwarded-Proto' in headers]
self.sbHandleReverseProxy = sickbeard.HANDLE_REVERSE_PROXY
self.sbThemeName = sickbeard.THEME_NAME
if headers['Host'][0] == '[':
self.sbHost = re.match('^\[.*\]', headers['Host'], re.X | re.M | re.S).group(0)
else:
self.sbHost = re.match('^[^:]+', headers['Host'], re.X | re.M | re.S).group(0)
if 'X-Forwarded-Host' in headers:
self.sbHost = headers['X-Forwarded-Host']
if 'X-Forwarded-Port' in headers:
sbHttpPort = headers['X-Forwarded-Port']
self.sbHttpsPort = sbHttpPort
if 'X-Forwarded-Proto' in headers:
self.sbHttpsEnabled = True if headers['X-Forwarded-Proto'] == 'https' else False
logPageTitle = 'Logs &amp; Errors'
log_page_title = 'Logs &amp; Errors'
if len(classes.ErrorViewer.errors):
logPageTitle += ' (' + str(len(classes.ErrorViewer.errors)) + ')'
self.logPageTitle = logPageTitle
log_page_title += ' (%s)' % len(classes.ErrorViewer.errors)
self.logPageTitle = log_page_title
self.sbPID = str(sickbeard.PID)
self.menu = [
{'title': 'Home', 'key': 'home'},
@ -112,9 +99,13 @@ class PageTemplate(Template):
{'title': 'History', 'key': 'history'},
{'title': 'Manage', 'key': 'manage'},
{'title': 'Config', 'key': 'config'},
{'title': logPageTitle, 'key': 'errorlogs'},
{'title': log_page_title, 'key': 'errorlogs'},
]
kwargs['file'] = os.path.join(sickbeard.PROG_DIR, 'gui/%s/interfaces/default/' %
sickbeard.GUI_NAME, kwargs['file'])
super(PageTemplate, self).__init__(*args, **kwargs)
def compile(self, *args, **kwargs):
if not os.path.exists(os.path.join(sickbeard.CACHE_DIR, 'cheetah')):
os.mkdir(os.path.join(sickbeard.CACHE_DIR, 'cheetah'))