Merge pull request #807 from JackDandy/feature/ChangeAddRoots

Change improve reverse proxy web_root support.
This commit is contained in:
JackDandy 2016-10-28 16:45:56 +01:00 committed by GitHub
commit 2021116657
14 changed files with 215 additions and 220 deletions

View file

@ -216,6 +216,7 @@
* Change ensure sbdatetime functions return formatted string instead of tuple * Change ensure sbdatetime functions return formatted string instead of tuple
* Change image cache processing for browse Trakt page * Change image cache processing for browse Trakt page
* Change logging for newznab response code 910 and add check for empty response data * Change logging for newznab response code 910 and add check for empty response data
* Change improve reverse proxy web_root support
### 0.11.16 (2016-10-16 17:30:00 UTC) ### 0.11.16 (2016-10-16 17:30:00 UTC)

View file

@ -266,7 +266,7 @@
<span class="component-desc"> <span class="component-desc">
<input type="text" name="show_tags" id="show_tags" value="$show_tags" class="form-control input-sm input300"> <input type="text" name="show_tags" id="show_tags" value="$show_tags" class="form-control input-sm input300">
<span>comma separated names</span> <span>comma separated names</span>
<p class="clear-left note">group shows to the order of this custom list (add shows to groups with <a href="/manage/">mass edit</a>)</p> <p class="clear-left note">group shows to the order of this custom list (add shows to groups with <a href="$sbRoot/manage/">mass edit</a>)</p>
</span> </span>
</label> </label>
</div> </div>

View file

@ -573,14 +573,14 @@
<td class="col-search"> <td class="col-search">
#if 0 != int($epResult['season']) #if 0 != int($epResult['season'])
#if (int($epResult['status']) in $Quality.SNATCHED or int($epResult['status']) in $Quality.DOWNLOADED) and $sickbeard.USE_FAILED_DOWNLOADS #if (int($epResult['status']) in $Quality.SNATCHED or int($epResult['status']) in $Quality.DOWNLOADED) and $sickbeard.USE_FAILED_DOWNLOADS
<a class="epRetry" id="#echo $epStr#" name="#echo $epStr#" href="retryEpisode?show=$show.indexerid&amp;season=$epResult['season']&amp;episode=$epResult['episode']"><img src="$sbRoot/images/search16.png" height="16" alt="retry" title="Retry download" /></a> <a class="epRetry" id="#echo $epStr#" name="#echo $epStr#" href="$sbRoot/home/retryEpisode?show=$show.indexerid&amp;season=$epResult['season']&amp;episode=$epResult['episode']"><img src="$sbRoot/images/search16.png" height="16" alt="retry" title="Retry download" /></a>
#else: #else:
<a class="epSearch" id="#echo $epStr#" name="#echo $epStr#" href="searchEpisode?show=$show.indexerid&amp;season=$epResult['season']&amp;episode=$epResult['episode']"><img src="$sbRoot/images/search16.png" width="16" height="16" alt="search" title="Manual search" /></a> <a class="epSearch" id="#echo $epStr#" name="#echo $epStr#" href="$sbRoot/home/searchEpisode?show=$show.indexerid&amp;season=$epResult['season']&amp;episode=$epResult['episode']"><img src="$sbRoot/images/search16.png" width="16" height="16" alt="search" title="Manual search" /></a>
#end if #end if
#end if #end if
#if $sickbeard.USE_SUBTITLES and $show.subtitles and len(set(str($epResult['subtitles']).split(',')).intersection(set($subtitles.wantedLanguages()))) < len($subtitles.wantedLanguages()) and $epResult['location'] #if $sickbeard.USE_SUBTITLES and $show.subtitles and len(set(str($epResult['subtitles']).split(',')).intersection(set($subtitles.wantedLanguages()))) < len($subtitles.wantedLanguages()) and $epResult['location']
<a class="epSubtitlesSearch" href="searchEpisodeSubtitles?show=$show.indexerid&amp;season=$epResult['season']&amp;episode=$epResult['episode']"><img src="$sbRoot/images/closed_captioning.png" height="16" alt="search subtitles" title="Search subtitles" /></a> <a class="epSubtitlesSearch" href="$sbRoot/home/searchEpisodeSubtitles?show=$show.indexerid&amp;season=$epResult['season']&amp;episode=$epResult['episode']"><img src="$sbRoot/images/closed_captioning.png" height="16" alt="search subtitles" title="Search subtitles" /></a>
#end if #end if
</td> </td>
</tr> </tr>

View file

@ -282,7 +282,7 @@
#if None is $curLoadingShow.show #if None is $curLoadingShow.show
Loading... ($curLoadingShow.show_name) Loading... ($curLoadingShow.show_name)
#else #else
<a href="displayShow?show=$curLoadingShow.show.indexerid">$curLoadingShow.show.name</a> <a href="$sbRoot/home/displayShow?show=$curLoadingShow.show.indexerid">$curLoadingShow.show.name</a>
#end if #end if
</td> </td>
<td></td> <td></td>

View file

@ -1,16 +1,87 @@
#import sickbeard <!DOCTYPE html>
#import datetime <head>
#from sickbeard.common import * <meta charset="utf-8">
#from sickbeard import db <meta name="robots" content="noindex, nofollow, noarchive, nocache, noodp, noydir, noimageindex, nosnippet">
## <meta name="viewport" content="width=device-width, initial-scale=1">
#set global $title = 'Home' <meta http-equiv="X-UA-Compatible" content="IE=edge">
#set global $header = 'Restarting SickGear'
#set global $sbPath = '..'
#set global $topmenu = 'home'
##
#import os.path
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/restart_bare.tmpl') <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">
<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">
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl') <script type="text/javascript" src="$sbRoot/js/lib/jquery-1.8.3.min.js?v=$sbPID"></script>
#try:
#set sgHost = $sbHost
#set sgPort = $sbHttpPort
#set sgUseHttps = $sbHttpsEnabled
#set themeSpinner = $sbThemeName
#except NameMapper.NotFound:
#set sgHost = 'localhost'
#set sgPort = $sickbeard.WEB_PORT
#set sgUseHttps = False
#set themeSpinner = $sickbeard.THEME_NAME
#end try
#set themeSpinner = '-dark' if 'dark' == themeSpinner else ''
##
<script type="text/javascript" charset="utf-8">
<!--
\$.SickGear = {
Root: '$sbRoot',
Host: '$sgHost',
Port: '$sgPort',
UseHttps: #echo ('!1', '!0')[False != $sgUseHttps and 0 != $sgUseHttps]#
};
//-->
</script>
<script type="text/javascript" src="$sbRoot/js/restart.js?v=$sbPID"></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}
</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">
</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>
<h2 class="sub-title">Performing Restart</h2>
<div id="shut_down_message">
<span class="desc"><span class="grey-text">Waiting for SickGear to</span> shut down: </span>
<span class="images"><i class="spinner"></i><span class="hide-yes"><i class="yes"></i></span></span>
</div>
<div class="hide" id="restart_message">
<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>
</div>
<div class="hide" id="refresh_message">
<span class="desc"><span class="grey-text">Waiting for SickGear </span> home page: </span>
<span class="images"><i class="spinner"></i></span>
</div>
<div class="hide" id="restart_fail_message">
<span class="red-text">Error:</span> The restart timed out, perhaps something prevented SickGear from starting ?
</div>
</body></html>

View file

@ -1,51 +1,7 @@
<script type="text/javascript" charset="utf-8"> ##############################################################################################################
<!-- ## This file is deprecated (Oct 2016) but services systems in transition to the refactored restart template ##
#try: ##############################################################################################################
#set curSBHost = $sbHost ##
#set curSBHttpPort = $sbHttpPort #import sickbeard
#set curSBHttpsEnabled = $sbHttpsEnabled #import os.path
#set curSBHandleReverseProxy = $sbHandleReverseProxy #include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/restart.tmpl')
#set themeSpinner = $sbThemeName
#except NameMapper.NotFound:
#set curSBHost = "localhost"
#set curSBHttpPort = $sickbeard.WEB_PORT
#set curSBHttpsEnabled = "False"
#set curSBHandleReverseProxy = "False"
#set themeSpinner = $sickbeard.THEME_NAME
#end try
sbRoot = "$sbRoot";
sbHttpPort = "$curSBHttpPort";
sbHttpsEnabled = "$curSBHttpsEnabled";
sbHandleReverseProxy = "$curSBHandleReverseProxy";
sbHost = "$curSBHost";
//-->
</script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery-1.8.3.min.js?v=$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/restart.js?v=$sbPID"></script>
#set themeSpinner = '-dark' if 'dark' == themeSpinner else ''
<h2>Performing Restart</h2>
<br />
<div id="shut_down_message">
Waiting for SickGear to shut down:
<img src="$sbRoot/images/loading16${themeSpinner}.gif" height="16" width="16" id="shut_down_loading" />
<img src="$sbRoot/images/yes16.png" height="16" width="16" id="shut_down_success" style="display: none;" />
</div>
<div id="restart_message" style="display: none;">
Waiting for SickGear to start again:
<img src="$sbRoot/images/loading16${themeSpinner}.gif" height="16" width="16" id="restart_loading" />
<img src="$sbRoot/images/yes16.png" height="16" width="16" id="restart_success" style="display: none;" />
<img src="$sbRoot/images/no16.png" height="16" width="16" id="restart_failure" style="display: none;" />
</div>
<div id="refresh_message" style="display: none;">
Loading the home page:
<img src="$sbRoot/images/loading16${themeSpinner}.gif" height="16" width="16" id="refresh_loading" />
</div>
<div id="restart_fail_message" style="display: none;">
Error: The restart has timed out, perhaps something prevented SickGear from starting again?
</div>

View file

@ -40,7 +40,7 @@
<button class="btn clearAll">Clear All</button> <button class="btn clearAll">Clear All</button>
</div> </div>
<input type="submit" value="Rename Selected" class="btn btn-success"> <a href="/home/displayShow?show=$show.indexerid" class="btn btn-danger">Cancel Rename</a> <input type="submit" value="Rename Selected" class="btn btn-success"> <a href="$sbRoot/home/displayShow?show=$show.indexerid" class="btn btn-danger">Cancel Rename</a>
<table id="testRenameTable" class="sickbeardTable" border="0"> <table id="testRenameTable" class="sickbeardTable" border="0">
## ##
@ -92,7 +92,7 @@
</table> </table>
<div style="clear:both;margin-top:20px"> <div style="clear:both;margin-top:20px">
<input type="submit" value="Rename Selected" class="btn btn-success"> <a href="/home/displayShow?show=$show.indexerid" class="btn btn-danger">Cancel Rename</a> <input type="submit" value="Rename Selected" class="btn btn-success"> <a href="$sbRoot/home/displayShow?show=$show.indexerid" class="btn btn-danger">Cancel Rename</a>
</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

@ -15,7 +15,7 @@ $(document).ready(function() {
subtitles = subtitles.split(',') subtitles = subtitles.split(',')
for (i in subtitles) for (i in subtitles)
{ {
row += ' <img src="/images/flags/'+subtitles[i]+'.png" width="16" height="11" alt="'+subtitles[i]+'" />&nbsp;'; row += ' <img src="' + sbRoot + '/images/flags/'+subtitles[i]+'.png" width="16" height="11" alt="'+subtitles[i]+'" />&nbsp;';
} }
row += ' </td>'; row += ' </td>';
row += ' </tr>' row += ' </tr>'

View file

@ -14,7 +14,7 @@ $(document).ready(function() {
if (0 == editArr.length) if (0 == editArr.length)
return !1; return !1;
window.location.href = $.SickGear.Root + 'massEdit?toEdit=' + editArr.join('|'); window.location.href = $.SickGear.Root + '/manage/massEdit?toEdit=' + editArr.join('|');
}); });

View file

@ -1,38 +1,41 @@
if (sbHttpsEnabled != "False" && sbHttpsEnabled != 0) { /** @namespace $.SickGear.Root */
var sb_base_url = 'https://' + sbHost + ':' + sbHttpPort + sbRoot; /** @namespace $.SickGear.Host */
} else { /** @namespace $.SickGear.Port */
var sb_base_url = 'http://' + sbHost + ':' + sbHttpPort + sbRoot; /** @namespace $.SickGear.UseHttps */
} /** @namespace data.msg */
var base_url = window.location.protocol + '//' + window.location.host + sbRoot; var sgRoot = $.SickGear.Root,
var is_alive_url = sbRoot + '/home/is_alive/'; browserUrl = window.location.protocol + '//' + window.location.host + sgRoot,
var timeout_id; baseUrl = 'http' + ($.SickGear.UseHttps ? 's' : '') + '://' + $.SickGear.Host + ':'
var current_pid = ''; + (('' == sgRoot) ? $.SickGear.Port : location.port) + sgRoot,
var num_restart_waits = 0; isAliveUrl = sgRoot + '/home/is_alive/',
timeoutId;
$.SickGear.currentPid = '';
$.SickGear.numRestartWaits = 0;
function is_alive() { function is_alive() {
timeout_id = 0; timeoutId = 0;
$.get(is_alive_url, function(data) { $.get(isAliveUrl, function(data) {
// if it's still initalizing then just wait and try again if ('nope' == data.msg.toString()) {
if (data.msg == 'nope') { // if initialising then just wait and try again
$('#shut_down_loading').hide();
$('#shut_down_success').show(); $('#shut_down_message').find('.spinner,.hide-yes').removeClass();
$('#restart_message').show(); $('#restart_message').removeClass();
setTimeout('is_alive()', 1000); setTimeout(is_alive, 250);
} else {
} else if ('' == $.SickGear.currentPid || $.SickGear.currentPid == data.msg) {
// if this is before we've even shut down then just try again later // if this is before we've even shut down then just try again later
if (current_pid == '' || data.msg == current_pid) {
current_pid = data.msg;
setTimeout(is_alive, 1000);
// if we're ready to go then redirect to new url $.SickGear.currentPid = data.msg;
setTimeout(is_alive, 250);
} else { } else {
$('#restart_loading').hide(); // if we're ready to go then redirect to new url
$('#restart_success').show();
$('#refresh_message').show(); $('#restart_message').find('.spinner,.hide-yes').removeClass();
window.location = sb_base_url + '/home/'; $('#refresh_message').removeClass();
} window.location = baseUrl + '/home/';
} }
}, 'jsonp'); }, 'jsonp');
} }
@ -41,38 +44,41 @@ $(document).ready(function() {
is_alive(); is_alive();
//noinspection JSUnusedLocalSymbols
$('#shut_down_message').ajaxError(function(e, jqxhr, settings, exception) { $('#shut_down_message').ajaxError(function(e, jqxhr, settings, exception) {
num_restart_waits += 1; $.SickGear.numRestartWaits += 1;
$('#shut_down_loading').hide(); $('#shut_down_message').find('.spinner,.hide-yes').removeClass();
$('#shut_down_success').show(); $('#restart_message').removeClass();
$('#restart_message').show(); isAliveUrl = baseUrl + '/home/is_alive/';
is_alive_url = sb_base_url + '/home/is_alive/';
// if https is enabled or you are currently on https and the port or protocol changed just wait 5 seconds then redirect. // if https is enabled or you are currently on https and the port or protocol changed just wait 5 seconds then redirect.
// This is because the ajax will fail if the cert is untrusted or the the http ajax requst from https will fail because of mixed content error. // This is because the ajax will fail if the cert is untrusted or the the http ajax request from https will fail because of mixed content error.
if ((sbHttpsEnabled != "False" && sbHttpsEnabled != 0) || window.location.protocol == "https:") { if ($.SickGear.UseHttps || 'https:' == window.location.protocol) {
if (base_url != sb_base_url) { if (browserUrl != baseUrl) {
timeout_id = 1;
timeoutId = 1;
setTimeout(function() { setTimeout(function() {
$('#restart_loading').hide(); $('#restart_message').find('.spinner,.hide-yes').removeClass();
$('#restart_success').show(); $('#refresh_message').removeClass();
$('#refresh_message').show();
}, 3000); }, 3000);
setTimeout("window.location = sb_base_url + '/home/'", 5000); setTimeout(function() {
window.location = baseUrl + '/home/'
}, 5000);
} }
} }
// if it is taking forever just give up // if it is taking forever just give up
if (num_restart_waits > 90) { if (90 < $.SickGear.numRestartWaits) {
$('#restart_loading').hide();
$('#restart_failure').show(); $('#restart_message').find('.spinner,.yes,.hide-no').removeClass();
$('#restart_fail_message').show(); $('#restart_fail_message').removeClass();
return; return;
} }
if (timeout_id == 0) { if (0 == timeoutId) {
timeout_id = setTimeout('is_alive()', 1000);
timeoutId = setTimeout(is_alive, 250);
} }
}); });

View file

@ -1310,11 +1310,7 @@ def start():
def halt(): def halt():
global __INITIALIZED__, backlogSearchScheduler, \ global __INITIALIZED__, started
showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \
properFinderScheduler, autoPostProcesserScheduler, searchQueueScheduler, \
subtitlesFinderScheduler, traktCheckerScheduler, \
recentSearchScheduler, events, started
with INIT_LOCK: with INIT_LOCK:
@ -1322,53 +1318,29 @@ def halt():
logger.log(u'Aborting all threads') logger.log(u'Aborting all threads')
events.stop.set() schedulers = [
logger.log(u'Waiting for the EVENTS thread to exit') recentSearchScheduler,
try: backlogSearchScheduler,
events.join(10) showUpdateScheduler,
except: versionCheckScheduler,
pass showQueueScheduler,
searchQueueScheduler,
recentSearchScheduler.stop.set() properFinderScheduler,
logger.log(u'Waiting for the RECENTSEARCH thread to exit') autoPostProcesserScheduler,
try: subtitlesFinderScheduler,
recentSearchScheduler.join(10)
except:
pass
backlogSearchScheduler.stop.set() events
logger.log(u'Waiting for the BACKLOG thread to exit') ]
try:
backlogSearchScheduler.join(10)
except:
pass
showUpdateScheduler.stop.set() for thread in schedulers:
logger.log(u'Waiting for the SHOWUPDATER thread to exit') thread.stop.set()
try:
showUpdateScheduler.join(10)
except:
pass
versionCheckScheduler.stop.set() for thread in schedulers:
logger.log(u'Waiting for the VERSIONCHECKER thread to exit') logger.log('Waiting for the %s thread to exit' % thread.name)
try: try:
versionCheckScheduler.join(10) thread.join(10)
except: except RuntimeError:
pass
showQueueScheduler.stop.set()
logger.log(u'Waiting for the SHOWQUEUE thread to exit')
try:
showQueueScheduler.join(10)
except:
pass
searchQueueScheduler.stop.set()
logger.log(u'Waiting for the SEARCHQUEUE thread to exit')
try:
searchQueueScheduler.join(10)
except:
pass pass
if PROCESS_AUTOMATICALLY: if PROCESS_AUTOMATICALLY:
@ -1379,14 +1351,6 @@ def halt():
except: except:
pass pass
# if USE_TRAKT:
# traktCheckerScheduler.stop.set()
# logger.log(u'Waiting for the TRAKTCHECKER thread to exit')
# try:
# traktCheckerScheduler.join(10)
# except:
# pass
if DOWNLOAD_PROPERS: if DOWNLOAD_PROPERS:
properFinderScheduler.stop.set() properFinderScheduler.stop.set()
logger.log(u'Waiting for the PROPERFINDER thread to exit') logger.log(u'Waiting for the PROPERFINDER thread to exit')

View file

@ -196,7 +196,8 @@ class PLEXNotifier:
if sickbeard.USE_PLEX and sickbeard.PLEX_UPDATE_LIBRARY or test: if sickbeard.USE_PLEX and sickbeard.PLEX_UPDATE_LIBRARY or test:
if not sickbeard.PLEX_SERVER_HOST and not any([host]): if not test:
if not sickbeard.PLEX_SERVER_HOST:
msg = u'No Plex Media Server host specified, check your settings' msg = u'No Plex Media Server host specified, check your settings'
self.log(msg, logger.DEBUG) self.log(msg, logger.DEBUG)
return '%sFail: %s' % (('', '<br />')[test], msg) return '%sFail: %s' % (('', '<br />')[test], msg)

View file

@ -707,7 +707,7 @@ class ProcessTVShow(object):
# processed in the past # processed in the past
return False return False
showlink = ('for "<a href="/home/displayShow?show=%s" target="_blank">%s</a>"' % (parse_result.show.indexerid, parse_result.show.name), showlink = ('for "<a href="%s/home/displayShow?show=%s" target="_blank">%s</a>"' % (sickbeard.WEB_ROOT, parse_result.show.indexerid, parse_result.show.name),
parse_result.show.name)[self.any_vid_processed] parse_result.show.name)[self.any_vid_processed]
ep_detail_sql = '' ep_detail_sql = ''

View file

@ -864,6 +864,8 @@ class Home(MainHandler):
password = sickbeard.PLEX_PASSWORD password = sickbeard.PLEX_PASSWORD
cur_result = notifiers.plex_notifier.test_notify(urllib.unquote_plus(host), username, password, server=True) cur_result = notifiers.plex_notifier.test_notify(urllib.unquote_plus(host), username, password, server=True)
if '<br />' == cur_result:
cur_result += 'Fail: No valid host set to connect with'
final_result = (('Test result for', 'Successful test of')['Fail' not in cur_result] final_result = (('Test result for', 'Successful test of')['Fail' not in cur_result]
+ ' Plex server(s) ... %s<br />\n' % cur_result) + ' Plex server(s) ... %s<br />\n' % cur_result)
@ -1117,7 +1119,6 @@ class Home(MainHandler):
return self.redirect('/home/') return self.redirect('/home/')
t = PageTemplate(headers=self.request.headers, file='restart.tmpl') t = PageTemplate(headers=self.request.headers, file='restart.tmpl')
t.submenu = self.HomeMenu()
# restart # restart
sickbeard.events.put(sickbeard.events.SystemEvent.RESTART) sickbeard.events.put(sickbeard.events.SystemEvent.RESTART)
@ -1129,16 +1130,11 @@ class Home(MainHandler):
if str(pid) != str(sickbeard.PID): if str(pid) != str(sickbeard.PID):
return self.redirect('/home/') return self.redirect('/home/')
updated = sickbeard.versionCheckScheduler.action.update() # @UndefinedVariable if sickbeard.versionCheckScheduler.action.update():
if updated: return self.restart(pid)
# do a hard restart
sickbeard.events.put(sickbeard.events.SystemEvent.RESTART)
t = PageTemplate(headers=self.request.headers, file='restart_bare.tmpl')
return t.respond()
else:
return self._genericMessage('Update Failed', return self._genericMessage('Update Failed',
"Update wasn't successful, not restarting. Check your log for more information.") 'Update wasn\'t successful, not restarting. Check your log for more information.')
def branchCheckout(self, branch): def branchCheckout(self, branch):
sickbeard.BRANCH = branch sickbeard.BRANCH = branch