1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Added a checkout branch button to the advanced config settings tab to tie things in better and make them easier.

This commit is contained in:
echel0n 2014-07-27 15:20:17 -07:00
parent ef8b4e587d
commit f4b24bd85d
4 changed files with 43 additions and 32 deletions

View File

@ -71,6 +71,7 @@ throwaway = datetime.datetime.strptime('20110101', '%Y%m%d')
signal.signal(signal.SIGINT, sickbeard.sig_handler)
signal.signal(signal.SIGTERM, sickbeard.sig_handler)
class SickRage(object):
def __init__(self):
# system event callback for shutdown/restart
@ -455,7 +456,8 @@ class SickRage(object):
sickbeard.showList.append(curShow)
except Exception, e:
logger.log(
u"There was an error creating the show in " + sqlShow["location"] + ": " + str(e).decode('utf-8', 'replace'),
u"There was an error creating the show in " + sqlShow["location"] + ": " + str(e).decode('utf-8',
'replace'),
logger.ERROR)
def restore(self, srcDir, dstDir):
@ -519,6 +521,7 @@ class SickRage(object):
# system exit
os._exit(0)
if __name__ == "__main__":
if sys.hexversion >= 0x020600F0:
freeze_support()

View File

@ -278,13 +278,14 @@
<div class="field-pair">
<label class="nocheck clearfix">
<span class="component-title">Git Branch:</span>
<span class="component-title">Branch Version:</span>
<span class="component-desc">
<select id="git_branch" name="git_branch">
<select id="branchVersion" name="branchVersion">
#for $cur_branch in $sickbeard.versionCheckScheduler.action.list_remote_branches():
<option value="$cur_branch" #if $cur_branch == $sickbeard.version.SICKBEARD_VERSION then "selected=\"selected\"" else ""#>$cur_branch.capitalize()</option>
#end for
</select>
<input class="btn" class="btn" type="button" id="branchCheckout" value="Checkout Branch">
</span>
</label>
<label class="nocheck clearfix">

View File

@ -56,7 +56,9 @@ $(document).ready(function(){
}
});
$('#api_key').click(function(){ $('#api_key').select() });
$('#api_key').click(function () {
$('#api_key').select()
});
$("#generate_new_apikey").click(function () {
$.get(sbRoot + '/config/general/generateKey',
function (data) {
@ -68,6 +70,14 @@ $(document).ready(function(){
});
});
$('#branchCheckout').click(function () {
$("#branchCheckout").attr("disabled", true);
var branchVersion = $("#branchVersion").val();
$.get(sbRoot + "/home/update", {'pid': sbPID, 'branch': branchVersion})
.done(function () {
$("#branchCheckout").attr("disabled", false);
});
});
});
function config_success() {

View File

@ -1436,7 +1436,7 @@ class ConfigGeneral(MainHandler):
handle_reverse_proxy=None, sort_article=None, auto_update=None, notify_on_update=None,
proxy_setting=None, anon_redirect=None, git_path=None, calendar_unprotected=None,
fuzzy_dating=None, trim_zero=None, date_preset=None, date_preset_na=None, time_preset=None,
indexer_timeout=None, play_videos=None, git_branch=None):
indexer_timeout=None, play_videos=None):
results = []
@ -1503,11 +1503,8 @@ class ConfigGeneral(MainHandler):
sickbeard.HANDLE_REVERSE_PROXY = config.checkbox_to_value(handle_reverse_proxy)
sickbeard.save_config()
sickbeard.versionCheckScheduler.action.update(git_branch)
if len(results) > 0:
for x in results:
logger.log(x, logger.ERROR)
@ -3455,12 +3452,12 @@ class Home(MainHandler):
return _munge(t)
def update(self, pid=None):
def update(self, pid=None, branch=None):
if str(pid) != str(sickbeard.PID):
redirect("/home/")
updated = sickbeard.versionCheckScheduler.action.update() # @UndefinedVariable
updated = sickbeard.versionCheckScheduler.action.update(branch) # @UndefinedVariable
if updated:
# do a hard restart
sickbeard.events.put(sickbeard.events.SystemEvent.RESTART)