mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Change improve reverse proxy web_root support.
Change refactor restart process, reducing restart time, improving ui, and fixing web_root. Change add response handling for invalid Plex Server hosts.
This commit is contained in:
parent
c20b847fb7
commit
440237a3c2
14 changed files with 215 additions and 220 deletions
|
@ -216,6 +216,7 @@
|
|||
* Change ensure sbdatetime functions return formatted string instead of tuple
|
||||
* Change image cache processing for browse Trakt page
|
||||
* 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)
|
||||
|
|
|
@ -266,7 +266,7 @@
|
|||
<span class="component-desc">
|
||||
<input type="text" name="show_tags" id="show_tags" value="$show_tags" class="form-control input-sm input300">
|
||||
<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>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
@ -573,14 +573,14 @@
|
|||
<td class="col-search">
|
||||
#if 0 != int($epResult['season'])
|
||||
#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&season=$epResult['season']&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&season=$epResult['season']&episode=$epResult['episode']"><img src="$sbRoot/images/search16.png" height="16" alt="retry" title="Retry download" /></a>
|
||||
#else:
|
||||
<a class="epSearch" id="#echo $epStr#" name="#echo $epStr#" href="searchEpisode?show=$show.indexerid&season=$epResult['season']&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&season=$epResult['season']&episode=$epResult['episode']"><img src="$sbRoot/images/search16.png" width="16" height="16" alt="search" title="Manual search" /></a>
|
||||
#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']
|
||||
<a class="epSubtitlesSearch" href="searchEpisodeSubtitles?show=$show.indexerid&season=$epResult['season']&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&season=$epResult['season']&episode=$epResult['episode']"><img src="$sbRoot/images/closed_captioning.png" height="16" alt="search subtitles" title="Search subtitles" /></a>
|
||||
#end if
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -282,7 +282,7 @@
|
|||
#if None is $curLoadingShow.show
|
||||
Loading... ($curLoadingShow.show_name)
|
||||
#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
|
||||
</td>
|
||||
<td></td>
|
||||
|
|
|
@ -1,16 +1,87 @@
|
|||
#import sickbeard
|
||||
#import datetime
|
||||
#from sickbeard.common import *
|
||||
#from sickbeard import db
|
||||
##
|
||||
#set global $title = 'Home'
|
||||
#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')
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="noindex, nofollow, noarchive, nocache, noodp, noydir, noimageindex, nosnippet">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
#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>
|
||||
|
|
|
@ -1,51 +1,7 @@
|
|||
<script type="text/javascript" charset="utf-8">
|
||||
<!--
|
||||
#try:
|
||||
#set curSBHost = $sbHost
|
||||
#set curSBHttpPort = $sbHttpPort
|
||||
#set curSBHttpsEnabled = $sbHttpsEnabled
|
||||
#set curSBHandleReverseProxy = $sbHandleReverseProxy
|
||||
#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>
|
||||
|
||||
##############################################################################################################
|
||||
## This file is deprecated (Oct 2016) but services systems in transition to the refactored restart template ##
|
||||
##############################################################################################################
|
||||
##
|
||||
#import sickbeard
|
||||
#import os.path
|
||||
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/restart.tmpl')
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
#import os.path
|
||||
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
|
||||
|
||||
#if $varExists('header')
|
||||
#if $varExists('header')
|
||||
<h1 class="header">$header</h1>
|
||||
#else
|
||||
#else
|
||||
<h1 class="title">$title</h1>
|
||||
#end if
|
||||
|
||||
|
@ -36,11 +36,11 @@
|
|||
#set $curSeason = -1
|
||||
#set $odd = False
|
||||
<div class="clearfix padbottom">
|
||||
<button class="btn seriesCheck">Select All Episodes</button>
|
||||
<button class="btn seriesCheck">Select All Episodes</button>
|
||||
<button class="btn clearAll">Clear All</button>
|
||||
</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">
|
||||
##
|
||||
|
@ -92,7 +92,7 @@
|
|||
</table>
|
||||
|
||||
<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>
|
||||
|
||||
#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')
|
||||
|
|
|
@ -15,7 +15,7 @@ $(document).ready(function() {
|
|||
subtitles = subtitles.split(',')
|
||||
for (i in subtitles)
|
||||
{
|
||||
row += ' <img src="/images/flags/'+subtitles[i]+'.png" width="16" height="11" alt="'+subtitles[i]+'" /> ';
|
||||
row += ' <img src="' + sbRoot + '/images/flags/'+subtitles[i]+'.png" width="16" height="11" alt="'+subtitles[i]+'" /> ';
|
||||
}
|
||||
row += ' </td>';
|
||||
row += ' </tr>'
|
||||
|
|
|
@ -14,7 +14,7 @@ $(document).ready(function() {
|
|||
if (0 == editArr.length)
|
||||
return !1;
|
||||
|
||||
window.location.href = $.SickGear.Root + 'massEdit?toEdit=' + editArr.join('|');
|
||||
window.location.href = $.SickGear.Root + '/manage/massEdit?toEdit=' + editArr.join('|');
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -1,79 +1,85 @@
|
|||
if (sbHttpsEnabled != "False" && sbHttpsEnabled != 0) {
|
||||
var sb_base_url = 'https://' + sbHost + ':' + sbHttpPort + sbRoot;
|
||||
} else {
|
||||
var sb_base_url = 'http://' + sbHost + ':' + sbHttpPort + sbRoot;
|
||||
}
|
||||
/** @namespace $.SickGear.Root */
|
||||
/** @namespace $.SickGear.Host */
|
||||
/** @namespace $.SickGear.Port */
|
||||
/** @namespace $.SickGear.UseHttps */
|
||||
/** @namespace data.msg */
|
||||
|
||||
var base_url = window.location.protocol + '//' + window.location.host + sbRoot;
|
||||
var is_alive_url = sbRoot + '/home/is_alive/';
|
||||
var timeout_id;
|
||||
var current_pid = '';
|
||||
var num_restart_waits = 0;
|
||||
var sgRoot = $.SickGear.Root,
|
||||
browserUrl = window.location.protocol + '//' + window.location.host + sgRoot,
|
||||
baseUrl = 'http' + ($.SickGear.UseHttps ? 's' : '') + '://' + $.SickGear.Host + ':'
|
||||
+ (('' == sgRoot) ? $.SickGear.Port : location.port) + sgRoot,
|
||||
isAliveUrl = sgRoot + '/home/is_alive/',
|
||||
timeoutId;
|
||||
$.SickGear.currentPid = '';
|
||||
$.SickGear.numRestartWaits = 0;
|
||||
|
||||
function is_alive() {
|
||||
timeout_id = 0;
|
||||
$.get(is_alive_url, function(data) {
|
||||
timeoutId = 0;
|
||||
$.get(isAliveUrl, function(data) {
|
||||
|
||||
// if it's still initalizing then just wait and try again
|
||||
if (data.msg == 'nope') {
|
||||
$('#shut_down_loading').hide();
|
||||
$('#shut_down_success').show();
|
||||
$('#restart_message').show();
|
||||
setTimeout('is_alive()', 1000);
|
||||
} else {
|
||||
// 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 ('nope' == data.msg.toString()) {
|
||||
// if initialising then just wait and try again
|
||||
|
||||
// if we're ready to go then redirect to new url
|
||||
} else {
|
||||
$('#restart_loading').hide();
|
||||
$('#restart_success').show();
|
||||
$('#refresh_message').show();
|
||||
window.location = sb_base_url + '/home/';
|
||||
}
|
||||
}
|
||||
}, 'jsonp');
|
||||
$('#shut_down_message').find('.spinner,.hide-yes').removeClass();
|
||||
$('#restart_message').removeClass();
|
||||
setTimeout(is_alive, 250);
|
||||
|
||||
} else if ('' == $.SickGear.currentPid || $.SickGear.currentPid == data.msg) {
|
||||
// if this is before we've even shut down then just try again later
|
||||
|
||||
$.SickGear.currentPid = data.msg;
|
||||
setTimeout(is_alive, 250);
|
||||
|
||||
} else {
|
||||
// if we're ready to go then redirect to new url
|
||||
|
||||
$('#restart_message').find('.spinner,.hide-yes').removeClass();
|
||||
$('#refresh_message').removeClass();
|
||||
window.location = baseUrl + '/home/';
|
||||
}
|
||||
}, 'jsonp');
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
is_alive();
|
||||
is_alive();
|
||||
|
||||
$('#shut_down_message').ajaxError(function(e, jqxhr, settings, exception) {
|
||||
num_restart_waits += 1;
|
||||
//noinspection JSUnusedLocalSymbols
|
||||
$('#shut_down_message').ajaxError(function(e, jqxhr, settings, exception) {
|
||||
$.SickGear.numRestartWaits += 1;
|
||||
|
||||
$('#shut_down_loading').hide();
|
||||
$('#shut_down_success').show();
|
||||
$('#restart_message').show();
|
||||
is_alive_url = sb_base_url + '/home/is_alive/';
|
||||
$('#shut_down_message').find('.spinner,.hide-yes').removeClass();
|
||||
$('#restart_message').removeClass();
|
||||
isAliveUrl = baseUrl + '/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.
|
||||
// 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.
|
||||
if ((sbHttpsEnabled != "False" && sbHttpsEnabled != 0) || window.location.protocol == "https:") {
|
||||
if (base_url != sb_base_url) {
|
||||
timeout_id = 1;
|
||||
setTimeout(function(){
|
||||
$('#restart_loading').hide();
|
||||
$('#restart_success').show();
|
||||
$('#refresh_message').show();
|
||||
}, 3000);
|
||||
setTimeout("window.location = sb_base_url + '/home/'", 5000);
|
||||
}
|
||||
}
|
||||
// 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 request from https will fail because of mixed content error.
|
||||
if ($.SickGear.UseHttps || 'https:' == window.location.protocol) {
|
||||
if (browserUrl != baseUrl) {
|
||||
|
||||
// if it is taking forever just give up
|
||||
if (num_restart_waits > 90) {
|
||||
$('#restart_loading').hide();
|
||||
$('#restart_failure').show();
|
||||
$('#restart_fail_message').show();
|
||||
return;
|
||||
}
|
||||
timeoutId = 1;
|
||||
setTimeout(function() {
|
||||
$('#restart_message').find('.spinner,.hide-yes').removeClass();
|
||||
$('#refresh_message').removeClass();
|
||||
}, 3000);
|
||||
setTimeout(function() {
|
||||
window.location = baseUrl + '/home/'
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
if (timeout_id == 0) {
|
||||
timeout_id = setTimeout('is_alive()', 1000);
|
||||
}
|
||||
});
|
||||
// if it is taking forever just give up
|
||||
if (90 < $.SickGear.numRestartWaits) {
|
||||
|
||||
});
|
||||
$('#restart_message').find('.spinner,.yes,.hide-no').removeClass();
|
||||
$('#restart_fail_message').removeClass();
|
||||
return;
|
||||
}
|
||||
|
||||
if (0 == timeoutId) {
|
||||
|
||||
timeoutId = setTimeout(is_alive, 250);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -1310,11 +1310,7 @@ def start():
|
|||
|
||||
|
||||
def halt():
|
||||
global __INITIALIZED__, backlogSearchScheduler, \
|
||||
showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \
|
||||
properFinderScheduler, autoPostProcesserScheduler, searchQueueScheduler, \
|
||||
subtitlesFinderScheduler, traktCheckerScheduler, \
|
||||
recentSearchScheduler, events, started
|
||||
global __INITIALIZED__, started
|
||||
|
||||
with INIT_LOCK:
|
||||
|
||||
|
@ -1322,54 +1318,30 @@ def halt():
|
|||
|
||||
logger.log(u'Aborting all threads')
|
||||
|
||||
events.stop.set()
|
||||
logger.log(u'Waiting for the EVENTS thread to exit')
|
||||
try:
|
||||
events.join(10)
|
||||
except:
|
||||
pass
|
||||
schedulers = [
|
||||
recentSearchScheduler,
|
||||
backlogSearchScheduler,
|
||||
showUpdateScheduler,
|
||||
versionCheckScheduler,
|
||||
showQueueScheduler,
|
||||
searchQueueScheduler,
|
||||
|
||||
recentSearchScheduler.stop.set()
|
||||
logger.log(u'Waiting for the RECENTSEARCH thread to exit')
|
||||
try:
|
||||
recentSearchScheduler.join(10)
|
||||
except:
|
||||
pass
|
||||
properFinderScheduler,
|
||||
autoPostProcesserScheduler,
|
||||
subtitlesFinderScheduler,
|
||||
|
||||
backlogSearchScheduler.stop.set()
|
||||
logger.log(u'Waiting for the BACKLOG thread to exit')
|
||||
try:
|
||||
backlogSearchScheduler.join(10)
|
||||
except:
|
||||
pass
|
||||
events
|
||||
]
|
||||
|
||||
showUpdateScheduler.stop.set()
|
||||
logger.log(u'Waiting for the SHOWUPDATER thread to exit')
|
||||
try:
|
||||
showUpdateScheduler.join(10)
|
||||
except:
|
||||
pass
|
||||
for thread in schedulers:
|
||||
thread.stop.set()
|
||||
|
||||
versionCheckScheduler.stop.set()
|
||||
logger.log(u'Waiting for the VERSIONCHECKER thread to exit')
|
||||
try:
|
||||
versionCheckScheduler.join(10)
|
||||
except:
|
||||
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
|
||||
for thread in schedulers:
|
||||
logger.log('Waiting for the %s thread to exit' % thread.name)
|
||||
try:
|
||||
thread.join(10)
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
if PROCESS_AUTOMATICALLY:
|
||||
autoPostProcesserScheduler.stop.set()
|
||||
|
@ -1379,14 +1351,6 @@ def halt():
|
|||
except:
|
||||
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:
|
||||
properFinderScheduler.stop.set()
|
||||
logger.log(u'Waiting for the PROPERFINDER thread to exit')
|
||||
|
|
|
@ -196,17 +196,18 @@ class PLEXNotifier:
|
|||
|
||||
if sickbeard.USE_PLEX and sickbeard.PLEX_UPDATE_LIBRARY or test:
|
||||
|
||||
if not sickbeard.PLEX_SERVER_HOST and not any([host]):
|
||||
msg = u'No Plex Media Server host specified, check your settings'
|
||||
self.log(msg, logger.DEBUG)
|
||||
return '%sFail: %s' % (('', '<br />')[test], msg)
|
||||
if not test:
|
||||
if not sickbeard.PLEX_SERVER_HOST:
|
||||
msg = u'No Plex Media Server host specified, check your settings'
|
||||
self.log(msg, logger.DEBUG)
|
||||
return '%sFail: %s' % (('', '<br />')[test], msg)
|
||||
|
||||
if not host:
|
||||
host = sickbeard.PLEX_SERVER_HOST
|
||||
if not username:
|
||||
username = sickbeard.PLEX_USERNAME
|
||||
if not password:
|
||||
password = sickbeard.PLEX_PASSWORD
|
||||
if not host:
|
||||
host = sickbeard.PLEX_SERVER_HOST
|
||||
if not username:
|
||||
username = sickbeard.PLEX_USERNAME
|
||||
if not password:
|
||||
password = sickbeard.PLEX_PASSWORD
|
||||
|
||||
# if username and password were provided, fetch the auth token from plex.tv
|
||||
token_arg = None
|
||||
|
|
|
@ -707,7 +707,7 @@ class ProcessTVShow(object):
|
|||
# processed in the past
|
||||
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]
|
||||
|
||||
ep_detail_sql = ''
|
||||
|
|
|
@ -864,6 +864,8 @@ class Home(MainHandler):
|
|||
password = sickbeard.PLEX_PASSWORD
|
||||
|
||||
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]
|
||||
+ ' Plex server(s) ... %s<br />\n' % cur_result)
|
||||
|
||||
|
@ -1117,7 +1119,6 @@ class Home(MainHandler):
|
|||
return self.redirect('/home/')
|
||||
|
||||
t = PageTemplate(headers=self.request.headers, file='restart.tmpl')
|
||||
t.submenu = self.HomeMenu()
|
||||
|
||||
# restart
|
||||
sickbeard.events.put(sickbeard.events.SystemEvent.RESTART)
|
||||
|
@ -1129,16 +1130,11 @@ class Home(MainHandler):
|
|||
if str(pid) != str(sickbeard.PID):
|
||||
return self.redirect('/home/')
|
||||
|
||||
updated = sickbeard.versionCheckScheduler.action.update() # @UndefinedVariable
|
||||
if updated:
|
||||
# do a hard restart
|
||||
sickbeard.events.put(sickbeard.events.SystemEvent.RESTART)
|
||||
if sickbeard.versionCheckScheduler.action.update():
|
||||
return self.restart(pid)
|
||||
|
||||
t = PageTemplate(headers=self.request.headers, file='restart_bare.tmpl')
|
||||
return t.respond()
|
||||
else:
|
||||
return self._genericMessage('Update Failed',
|
||||
"Update wasn't successful, not restarting. Check your log for more information.")
|
||||
return self._genericMessage('Update Failed',
|
||||
'Update wasn\'t successful, not restarting. Check your log for more information.')
|
||||
|
||||
def branchCheckout(self, branch):
|
||||
sickbeard.BRANCH = branch
|
||||
|
|
Loading…
Reference in a new issue