mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Fixed issue #1055, adding existing shows with prompt for settings
This commit is contained in:
parent
d183debc4b
commit
de24e52be6
@ -44,11 +44,11 @@
|
|||||||
<input type="hidden" id="indexer_timeout" value="$sickbeard.INDEXER_TIMEOUT" />
|
<input type="hidden" id="indexer_timeout" value="$sickbeard.INDEXER_TIMEOUT" />
|
||||||
|
|
||||||
#if $use_provided_info:
|
#if $use_provided_info:
|
||||||
Show retrieved from existing metadata: <a href="<%= anon_url(sickbeard.indexerApi(provided_indexer).config['show_url'], provided_indexer_id) %>">$provided_indexer_name</a>
|
Show retrieved from existing metadata: <a href="$anon_url($sickbeard.indexerApi($provided_indexer).config['show_url'], $provided_indexer_id)">$provided_indexer_name</a>
|
||||||
<input type="hidden" name="indexerLang" value="en" />
|
<input type="hidden" id="indexerLang" name="indexerLang" value="en" />
|
||||||
<input type="hidden" name="whichSeries" value="$provided_indexer_id" />
|
<input type="hidden" id="whichSeries" name="whichSeries" value="$provided_indexer_id" />
|
||||||
|
<input type="hidden" id="providedIndexer" name="providedIndexer" value="$provided_indexer" />
|
||||||
<input type="hidden" id="providedName" value="$provided_indexer_name" />
|
<input type="hidden" id="providedName" value="$provided_indexer_name" />
|
||||||
<input type="hidden" id="providedIndexer" value="$provided_indexer" />
|
|
||||||
#else:
|
#else:
|
||||||
|
|
||||||
<input type="text" id="nameToSearch" value="$default_show_name" class="form-control form-control-inline input-sm input350" />
|
<input type="text" id="nameToSearch" value="$default_show_name" class="form-control form-control-inline input-sm input350" />
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#checkAll').live('click', function(){
|
$('#tableDiv').on('click', '#checkAll', function() {
|
||||||
|
|
||||||
var seasCheck = this;
|
var seasCheck = this;
|
||||||
|
|
||||||
$('.dirCheck').each(function() {
|
$('.dirCheck').each(function() {
|
||||||
this.checked = seasCheck.checked;
|
this.checked = seasCheck.checked;
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#submitShowDirs').click(function() {
|
$('#submitShowDirs').click(function() {
|
||||||
|
|
||||||
var dirArr = new Array();
|
var dirArr = new Array();
|
||||||
|
|
||||||
$('.dirCheck').each(function(i,w) {
|
$('.dirCheck').each(function(i,w) {
|
||||||
if (this.checked == true) {
|
if (this.checked == true) {
|
||||||
var show = $(this).attr('id');
|
var show = $(this).attr('id');
|
||||||
@ -21,14 +20,15 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (dirArr.length == 0)
|
if (dirArr.length == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
url = sbRoot + '/home/addShows/addExistingShows?promptForSettings=' + ($('#promptForSettings').prop('checked') ? 'on' : 'off');
|
url = sbRoot + '/home/addShows/addExistingShows?promptForSettings=' + ($('#promptForSettings').prop('checked') ? 'on' : 'off');
|
||||||
|
|
||||||
url += '&shows_to_add=' + dirArr.join('&shows_to_add=');
|
url += '&shows_to_add=' + dirArr.join('&shows_to_add=');
|
||||||
|
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -36,14 +36,15 @@ $(document).ready(function() {
|
|||||||
var url = '';
|
var url = '';
|
||||||
$('.dir_check').each(function(i,w) {
|
$('.dir_check').each(function(i,w) {
|
||||||
if ($(w).is(':checked')) {
|
if ($(w).is(':checked')) {
|
||||||
if (url.length)
|
if (url.length) {
|
||||||
url += '&';
|
url += '&';
|
||||||
|
}
|
||||||
url += 'rootDir=' + encodeURIComponent($(w).attr('id'));
|
url += 'rootDir=' + encodeURIComponent($(w).attr('id'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#tableDiv').html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32' + themeSpinner + '.gif" height="32" width="32" /> loading folders...');
|
$('#tableDiv').html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32.gif" height="32" width="32" /> loading folders...');
|
||||||
$.get(sbRoot+'/home/addShows/massAddTable', url, function(data) {
|
$.get(sbRoot + '/home/addShows/massAddTable/', url, function(data) {
|
||||||
$('#tableDiv').html(data);
|
$('#tableDiv').html(data);
|
||||||
$("#addRootDirTable").tablesorter({
|
$("#addRootDirTable").tablesorter({
|
||||||
//sortList: [[1,0]],
|
//sortList: [[1,0]],
|
||||||
@ -58,21 +59,24 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
var last_txt = '';
|
var last_txt = '';
|
||||||
$('#rootDirText').change(function() {
|
$('#rootDirText').change(function() {
|
||||||
if (last_txt == $('#rootDirText').val())
|
if (last_txt == $('#rootDirText').val()) {
|
||||||
return false;
|
return false;
|
||||||
else
|
} else {
|
||||||
last_txt = $('#rootDirText').val();
|
last_txt = $('#rootDirText').val();
|
||||||
|
}
|
||||||
$('#rootDirStaticList').html('');
|
$('#rootDirStaticList').html('');
|
||||||
$('#rootDirs option').each(function(i, w) {
|
$('#rootDirs option').each(function(i, w) {
|
||||||
$('#rootDirStaticList').append('<li class="ui-state-default ui-corner-all"><input type="checkbox" class="dir_check" id="'+$(w).val()+'" checked=checked> <label for="'+$(w).val()+'" style="color:#09A2FF;"><b>'+$(w).val()+'</b></label></li>')
|
$('#rootDirStaticList').append('<li class="ui-state-default ui-corner-all"><input type="checkbox" class="cb dir_check" id="' + $(w).val() + '" checked=checked> <label for="' + $(w).val() + '"><b>' + $(w).val() + '</b></label></li>');
|
||||||
});
|
});
|
||||||
loadContent();
|
loadContent();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.dir_check').live('click', loadContent);
|
$('#rootDirStaticList').on('click', '.dir_check', loadContent);
|
||||||
|
|
||||||
$('.showManage').live('click', function() {
|
$('#tableDiv').on('click', '.showManage', function(event) {
|
||||||
$( "#tabs" ).tabs( 'select', 0 );
|
event.preventDefault();
|
||||||
|
$("#tabs").tabs('option', 'active', 0);
|
||||||
|
$('html,body').animate({scrollTop:0}, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
@ -138,7 +138,7 @@ class BaseHandler(RequestHandler):
|
|||||||
url = self.request.uri[len(index_url):]
|
url = self.request.uri[len(index_url):]
|
||||||
|
|
||||||
if url[:3] != 'api':
|
if url[:3] != 'api':
|
||||||
self.redirect(url)
|
return self.redirect(url)
|
||||||
else:
|
else:
|
||||||
self.write('Wrong API key used')
|
self.write('Wrong API key used')
|
||||||
self.finish()
|
self.finish()
|
||||||
@ -165,7 +165,7 @@ class BaseHandler(RequestHandler):
|
|||||||
trace_info, request_info))
|
trace_info, request_info))
|
||||||
|
|
||||||
def redirect(self, url, permanent=True, status=None):
|
def redirect(self, url, permanent=True, status=None):
|
||||||
return super(BaseHandler, self).redirect(sickbeard.WEB_ROOT + url, permanent, status)
|
super(BaseHandler, self).redirect(sickbeard.WEB_ROOT + url, permanent, status)
|
||||||
|
|
||||||
def get_current_user(self, *args, **kwargs):
|
def get_current_user(self, *args, **kwargs):
|
||||||
if not isinstance(self, UI) and sickbeard.WEB_USERNAME and sickbeard.WEB_PASSWORD:
|
if not isinstance(self, UI) and sickbeard.WEB_USERNAME and sickbeard.WEB_PASSWORD:
|
||||||
@ -206,6 +206,7 @@ class WebHandler(BaseHandler):
|
|||||||
return result
|
return result
|
||||||
except:
|
except:
|
||||||
logger.log('Failed doing webui callback: %s' % (traceback.format_exc()), logger.ERROR)
|
logger.log('Failed doing webui callback: %s' % (traceback.format_exc()), logger.ERROR)
|
||||||
|
raise
|
||||||
|
|
||||||
def async_done(self, results):
|
def async_done(self, results):
|
||||||
try:
|
try:
|
||||||
@ -219,7 +220,7 @@ class WebHandler(BaseHandler):
|
|||||||
self.finish()
|
self.finish()
|
||||||
except:
|
except:
|
||||||
logger.log('Failed sending webui reponse: %s' % (traceback.format_exc()), logger.DEBUG)
|
logger.log('Failed sending webui reponse: %s' % (traceback.format_exc()), logger.DEBUG)
|
||||||
self.finish()
|
raise
|
||||||
|
|
||||||
def _genericMessage(self, subject, message):
|
def _genericMessage(self, subject, message):
|
||||||
t = PageTemplate(rh=self, file="genericMessage.tmpl")
|
t = PageTemplate(rh=self, file="genericMessage.tmpl")
|
||||||
@ -270,7 +271,7 @@ class LoginHandler(BaseHandler):
|
|||||||
def get(self, *args, **kwargs):
|
def get(self, *args, **kwargs):
|
||||||
|
|
||||||
if self.get_current_user():
|
if self.get_current_user():
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
else:
|
else:
|
||||||
t = PageTemplate(rh=self, file="login.tmpl")
|
t = PageTemplate(rh=self, file="login.tmpl")
|
||||||
self.write(ek.ss(t).encode('utf-8', 'xmlcharrefreplace'))
|
self.write(ek.ss(t).encode('utf-8', 'xmlcharrefreplace'))
|
||||||
@ -290,13 +291,13 @@ class LoginHandler(BaseHandler):
|
|||||||
remember_me = int(self.get_argument('remember_me', default=0) or 0)
|
remember_me = int(self.get_argument('remember_me', default=0) or 0)
|
||||||
self.set_secure_cookie('user', api_key, expires_days=30 if remember_me > 0 else None)
|
self.set_secure_cookie('user', api_key, expires_days=30 if remember_me > 0 else None)
|
||||||
|
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
|
|
||||||
class LogoutHandler(BaseHandler):
|
class LogoutHandler(BaseHandler):
|
||||||
def get(self, *args, **kwargs):
|
def get(self, *args, **kwargs):
|
||||||
self.clear_cookie("user")
|
self.clear_cookie("user")
|
||||||
self.redirect('/login/')
|
return self.redirect('/login/')
|
||||||
|
|
||||||
|
|
||||||
class KeyHandler(RequestHandler):
|
class KeyHandler(RequestHandler):
|
||||||
@ -323,7 +324,7 @@ class KeyHandler(RequestHandler):
|
|||||||
@route('(.*)(/?)')
|
@route('(.*)(/?)')
|
||||||
class WebRoot(WebHandler):
|
class WebRoot(WebHandler):
|
||||||
def index(self):
|
def index(self):
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
def robots_txt(self):
|
def robots_txt(self):
|
||||||
""" Keep web crawlers out """
|
""" Keep web crawlers out """
|
||||||
@ -388,7 +389,7 @@ class WebRoot(WebHandler):
|
|||||||
image_path = image_file_name
|
image_path = image_file_name
|
||||||
static_image_path = '/cache' + image_path.replace(sickbeard.CACHE_DIR, '')
|
static_image_path = '/cache' + image_path.replace(sickbeard.CACHE_DIR, '')
|
||||||
|
|
||||||
self.redirect(static_image_path)
|
return self.redirect(static_image_path)
|
||||||
|
|
||||||
def setHomeLayout(self, layout):
|
def setHomeLayout(self, layout):
|
||||||
|
|
||||||
@ -397,7 +398,7 @@ class WebRoot(WebHandler):
|
|||||||
|
|
||||||
sickbeard.HOME_LAYOUT = layout
|
sickbeard.HOME_LAYOUT = layout
|
||||||
|
|
||||||
self.redirect("/home/")
|
return self.redirect("/home/")
|
||||||
|
|
||||||
def setPosterSortBy(self, sort):
|
def setPosterSortBy(self, sort):
|
||||||
|
|
||||||
@ -419,13 +420,13 @@ class WebRoot(WebHandler):
|
|||||||
|
|
||||||
sickbeard.HISTORY_LAYOUT = layout
|
sickbeard.HISTORY_LAYOUT = layout
|
||||||
|
|
||||||
self.redirect("/history/")
|
return self.redirect("/history/")
|
||||||
|
|
||||||
def toggleDisplayShowSpecials(self, show):
|
def toggleDisplayShowSpecials(self, show):
|
||||||
|
|
||||||
sickbeard.DISPLAY_SHOW_SPECIALS = not sickbeard.DISPLAY_SHOW_SPECIALS
|
sickbeard.DISPLAY_SHOW_SPECIALS = not sickbeard.DISPLAY_SHOW_SPECIALS
|
||||||
|
|
||||||
self.redirect("/home/displayShow?show=" + show)
|
return self.redirect("/home/displayShow?show=" + show)
|
||||||
|
|
||||||
def setComingEpsLayout(self, layout):
|
def setComingEpsLayout(self, layout):
|
||||||
if layout not in ('poster', 'banner', 'list', 'calendar'):
|
if layout not in ('poster', 'banner', 'list', 'calendar'):
|
||||||
@ -436,13 +437,13 @@ class WebRoot(WebHandler):
|
|||||||
|
|
||||||
sickbeard.COMING_EPS_LAYOUT = layout
|
sickbeard.COMING_EPS_LAYOUT = layout
|
||||||
|
|
||||||
self.redirect("/comingEpisodes/")
|
return self.redirect("/comingEpisodes/")
|
||||||
|
|
||||||
def toggleComingEpsDisplayPaused(self):
|
def toggleComingEpsDisplayPaused(self):
|
||||||
|
|
||||||
sickbeard.COMING_EPS_DISPLAY_PAUSED = not sickbeard.COMING_EPS_DISPLAY_PAUSED
|
sickbeard.COMING_EPS_DISPLAY_PAUSED = not sickbeard.COMING_EPS_DISPLAY_PAUSED
|
||||||
|
|
||||||
self.redirect("/comingEpisodes/")
|
return self.redirect("/comingEpisodes/")
|
||||||
|
|
||||||
def setComingEpsSort(self, sort):
|
def setComingEpsSort(self, sort):
|
||||||
if sort not in ('date', 'network', 'show'):
|
if sort not in ('date', 'network', 'show'):
|
||||||
@ -454,7 +455,7 @@ class WebRoot(WebHandler):
|
|||||||
|
|
||||||
sickbeard.COMING_EPS_SORT = sort
|
sickbeard.COMING_EPS_SORT = sort
|
||||||
|
|
||||||
self.redirect("/comingEpisodes/")
|
return self.redirect("/comingEpisodes/")
|
||||||
|
|
||||||
def comingEpisodes(self, layout="None"):
|
def comingEpisodes(self, layout="None"):
|
||||||
|
|
||||||
@ -957,8 +958,7 @@ class Home(WebRoot):
|
|||||||
|
|
||||||
def shutdown(self, pid=None):
|
def shutdown(self, pid=None):
|
||||||
if str(pid) != str(sickbeard.PID):
|
if str(pid) != str(sickbeard.PID):
|
||||||
self.redirect("/home/")
|
return self.redirect("/home/")
|
||||||
return
|
|
||||||
|
|
||||||
sickbeard.events.put(sickbeard.events.SystemEvent.SHUTDOWN)
|
sickbeard.events.put(sickbeard.events.SystemEvent.SHUTDOWN)
|
||||||
|
|
||||||
@ -969,8 +969,7 @@ class Home(WebRoot):
|
|||||||
|
|
||||||
def restart(self, pid=None):
|
def restart(self, pid=None):
|
||||||
if str(pid) != str(sickbeard.PID):
|
if str(pid) != str(sickbeard.PID):
|
||||||
self.redirect("/home/")
|
return self.redirect("/home/")
|
||||||
return
|
|
||||||
|
|
||||||
t = PageTemplate(rh=self, file="restart.tmpl")
|
t = PageTemplate(rh=self, file="restart.tmpl")
|
||||||
t.submenu = self.HomeMenu()
|
t.submenu = self.HomeMenu()
|
||||||
@ -982,16 +981,16 @@ class Home(WebRoot):
|
|||||||
|
|
||||||
def updateCheck(self, pid=None):
|
def updateCheck(self, pid=None):
|
||||||
if str(pid) != str(sickbeard.PID):
|
if str(pid) != str(sickbeard.PID):
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||||
sickbeard.versionCheckScheduler.action.check_for_new_version(force=True)
|
sickbeard.versionCheckScheduler.action.check_for_new_version(force=True)
|
||||||
|
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
def update(self, pid=None):
|
def update(self, pid=None):
|
||||||
if str(pid) != str(sickbeard.PID):
|
if str(pid) != str(sickbeard.PID):
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
if sickbeard.versionCheckScheduler.action.update():
|
if sickbeard.versionCheckScheduler.action.update():
|
||||||
# do a hard restart
|
# do a hard restart
|
||||||
@ -1388,7 +1387,7 @@ class Home(WebRoot):
|
|||||||
ui.notifications.error('%d error%s while saving changes:' % (len(errors), "" if len(errors) == 1 else "s"),
|
ui.notifications.error('%d error%s while saving changes:' % (len(errors), "" if len(errors) == 1 else "s"),
|
||||||
'<ul>' + '\n'.join(['<li>%s</li>' % error for error in errors]) + "</ul>")
|
'<ul>' + '\n'.join(['<li>%s</li>' % error for error in errors]) + "</ul>")
|
||||||
|
|
||||||
self.redirect("/home/displayShow?show=" + show)
|
return self.redirect("/home/displayShow?show=" + show)
|
||||||
|
|
||||||
|
|
||||||
def deleteShow(self, show=None, full=0):
|
def deleteShow(self, show=None, full=0):
|
||||||
@ -1415,7 +1414,7 @@ class Home(WebRoot):
|
|||||||
(showObj.name,
|
(showObj.name,
|
||||||
('deleted', 'trashed')[sickbeard.TRASH_REMOVE_SHOW],
|
('deleted', 'trashed')[sickbeard.TRASH_REMOVE_SHOW],
|
||||||
('(media untouched)', '(with all related media)')[bool(full)]))
|
('(media untouched)', '(with all related media)')[bool(full)]))
|
||||||
self.redirect("/home/")
|
return self.redirect("/home/")
|
||||||
|
|
||||||
|
|
||||||
def refreshShow(self, show=None):
|
def refreshShow(self, show=None):
|
||||||
@ -1437,7 +1436,7 @@ class Home(WebRoot):
|
|||||||
|
|
||||||
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
|
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
|
||||||
|
|
||||||
self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
|
return self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
|
||||||
|
|
||||||
|
|
||||||
def updateShow(self, show=None, force=0):
|
def updateShow(self, show=None, force=0):
|
||||||
@ -1459,7 +1458,7 @@ class Home(WebRoot):
|
|||||||
# just give it some time
|
# just give it some time
|
||||||
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
|
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
|
||||||
|
|
||||||
self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
|
return self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
|
||||||
|
|
||||||
def subtitleShow(self, show=None, force=0):
|
def subtitleShow(self, show=None, force=0):
|
||||||
|
|
||||||
@ -1476,7 +1475,7 @@ class Home(WebRoot):
|
|||||||
|
|
||||||
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
|
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
|
||||||
|
|
||||||
self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
|
return self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
|
||||||
|
|
||||||
|
|
||||||
def updateKODI(self, showName=None):
|
def updateKODI(self, showName=None):
|
||||||
@ -1492,7 +1491,7 @@ class Home(WebRoot):
|
|||||||
ui.notifications.message("Library update command sent to KODI host(s): " + host)
|
ui.notifications.message("Library update command sent to KODI host(s): " + host)
|
||||||
else:
|
else:
|
||||||
ui.notifications.error("Unable to contact one or more KODI host(s): " + host)
|
ui.notifications.error("Unable to contact one or more KODI host(s): " + host)
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
|
|
||||||
def updatePLEX(self):
|
def updatePLEX(self):
|
||||||
@ -1501,7 +1500,7 @@ class Home(WebRoot):
|
|||||||
"Library update command sent to Plex Media Server host: " + sickbeard.PLEX_SERVER_HOST)
|
"Library update command sent to Plex Media Server host: " + sickbeard.PLEX_SERVER_HOST)
|
||||||
else:
|
else:
|
||||||
ui.notifications.error("Unable to contact Plex Media Server host: " + sickbeard.PLEX_SERVER_HOST)
|
ui.notifications.error("Unable to contact Plex Media Server host: " + sickbeard.PLEX_SERVER_HOST)
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
|
|
||||||
def setStatus(self, show=None, eps=None, status=None, direct=False):
|
def setStatus(self, show=None, eps=None, status=None, direct=False):
|
||||||
@ -1621,7 +1620,7 @@ class Home(WebRoot):
|
|||||||
if direct:
|
if direct:
|
||||||
return json.dumps({'result': 'success'})
|
return json.dumps({'result': 'success'})
|
||||||
else:
|
else:
|
||||||
self.redirect("/home/displayShow?show=" + show)
|
return self.redirect("/home/displayShow?show=" + show)
|
||||||
|
|
||||||
|
|
||||||
def testRename(self, show=None):
|
def testRename(self, show=None):
|
||||||
@ -1688,7 +1687,7 @@ class Home(WebRoot):
|
|||||||
return self._genericMessage("Error", "Can't rename episodes when the show dir is missing.")
|
return self._genericMessage("Error", "Can't rename episodes when the show dir is missing.")
|
||||||
|
|
||||||
if eps is None:
|
if eps is None:
|
||||||
self.redirect("/home/displayShow?show=" + show)
|
return self.redirect("/home/displayShow?show=" + show)
|
||||||
|
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
for curEp in eps.split('|'):
|
for curEp in eps.split('|'):
|
||||||
@ -1715,7 +1714,7 @@ class Home(WebRoot):
|
|||||||
|
|
||||||
root_ep_obj.rename()
|
root_ep_obj.rename()
|
||||||
|
|
||||||
self.redirect("/home/displayShow?show=" + show)
|
return self.redirect("/home/displayShow?show=" + show)
|
||||||
|
|
||||||
def searchEpisode(self, show=None, season=None, episode=None):
|
def searchEpisode(self, show=None, season=None, episode=None):
|
||||||
|
|
||||||
@ -1963,7 +1962,7 @@ class HomePostProcess(Home):
|
|||||||
is_priority = False
|
is_priority = False
|
||||||
|
|
||||||
if not dir:
|
if not dir:
|
||||||
self.redirect("/home/postprocess/")
|
return self.redirect("/home/postprocess/")
|
||||||
else:
|
else:
|
||||||
result = processTV.processDir(dir, nzbName, process_method=process_method, force=force,
|
result = processTV.processDir(dir, nzbName, process_method=process_method, force=force,
|
||||||
is_priority=is_priority, failed=failed, type=type)
|
is_priority=is_priority, failed=failed, type=type)
|
||||||
@ -2286,7 +2285,7 @@ class HomeAddShows(Home):
|
|||||||
return "No root directories setup, please go back and add one."
|
return "No root directories setup, please go back and add one."
|
||||||
|
|
||||||
# done adding show
|
# done adding show
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
def addNewShow(self, whichSeries=None, indexerLang="en", rootDir=None, defaultStatus=None,
|
def addNewShow(self, whichSeries=None, indexerLang="en", rootDir=None, defaultStatus=None,
|
||||||
anyQualities=None, bestQualities=None, flatten_folders=None, subtitles=None,
|
anyQualities=None, bestQualities=None, flatten_folders=None, subtitles=None,
|
||||||
@ -2306,7 +2305,7 @@ class HomeAddShows(Home):
|
|||||||
def finishAddShow():
|
def finishAddShow():
|
||||||
# if there are no extra shows then go home
|
# if there are no extra shows then go home
|
||||||
if not other_shows:
|
if not other_shows:
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
# peel off the next one
|
# peel off the next one
|
||||||
next_show_dir = other_shows[0]
|
next_show_dir = other_shows[0]
|
||||||
@ -2331,7 +2330,7 @@ class HomeAddShows(Home):
|
|||||||
logger.log("Unable to add show due to show selection. Not anough arguments: %s" % (repr(series_pieces)),
|
logger.log("Unable to add show due to show selection. Not anough arguments: %s" % (repr(series_pieces)),
|
||||||
logger.ERROR)
|
logger.ERROR)
|
||||||
ui.notifications.error("Unknown error. Unable to add show due to problem with show selection.")
|
ui.notifications.error("Unknown error. Unable to add show due to problem with show selection.")
|
||||||
self.redirect('/home/addShows/existingShows/')
|
return self.redirect('/home/addShows/existingShows/')
|
||||||
|
|
||||||
indexer = int(series_pieces[1])
|
indexer = int(series_pieces[1])
|
||||||
indexer_id = int(series_pieces[3])
|
indexer_id = int(series_pieces[3])
|
||||||
@ -2354,7 +2353,7 @@ class HomeAddShows(Home):
|
|||||||
# blanket policy - if the dir exists you should have used "add existing show" numbnuts
|
# blanket policy - if the dir exists you should have used "add existing show" numbnuts
|
||||||
if ek.ek(os.path.isdir, show_dir) and not fullShowPath:
|
if ek.ek(os.path.isdir, show_dir) and not fullShowPath:
|
||||||
ui.notifications.error("Unable to add show", "Folder " + show_dir + " exists already")
|
ui.notifications.error("Unable to add show", "Folder " + show_dir + " exists already")
|
||||||
self.redirect('/home/addShows/existingShows/')
|
return self.redirect('/home/addShows/existingShows/')
|
||||||
|
|
||||||
# don't create show dir if config says not to
|
# don't create show dir if config says not to
|
||||||
if sickbeard.ADD_SHOWS_WO_DIR:
|
if sickbeard.ADD_SHOWS_WO_DIR:
|
||||||
@ -2365,7 +2364,7 @@ class HomeAddShows(Home):
|
|||||||
logger.log(u"Unable to create the folder " + show_dir + ", can't add the show", logger.ERROR)
|
logger.log(u"Unable to create the folder " + show_dir + ", can't add the show", logger.ERROR)
|
||||||
ui.notifications.error("Unable to add show",
|
ui.notifications.error("Unable to add show",
|
||||||
"Unable to create the folder " + show_dir + ", can't add the show")
|
"Unable to create the folder " + show_dir + ", can't add the show")
|
||||||
self.redirect("/home/")
|
return self.redirect("/home/")
|
||||||
else:
|
else:
|
||||||
helpers.chmodAsParent(show_dir)
|
helpers.chmodAsParent(show_dir)
|
||||||
|
|
||||||
@ -2470,7 +2469,7 @@ class HomeAddShows(Home):
|
|||||||
|
|
||||||
# if we're done then go home
|
# if we're done then go home
|
||||||
if not dirs_only:
|
if not dirs_only:
|
||||||
self.redirect('/home/')
|
return self.redirect('/home/')
|
||||||
|
|
||||||
# for the remaining shows we need to prompt for each one, so forward this on to the newShow page
|
# for the remaining shows we need to prompt for each one, so forward this on to the newShow page
|
||||||
return self.newShow(dirs_only[0], dirs_only[1:])
|
return self.newShow(dirs_only[0], dirs_only[1:])
|
||||||
@ -2606,7 +2605,7 @@ class Manage(WebRoot):
|
|||||||
WebRoot.Home.setStatus(cur_indexer_id, '|'.join(to_change[cur_indexer_id]),
|
WebRoot.Home.setStatus(cur_indexer_id, '|'.join(to_change[cur_indexer_id]),
|
||||||
newStatus, direct=True)
|
newStatus, direct=True)
|
||||||
|
|
||||||
self.redirect('/manage/episodeStatuses/')
|
return self.redirect('/manage/episodeStatuses/')
|
||||||
|
|
||||||
|
|
||||||
def showSubtitleMissed(self, indexer_id, whichSubs):
|
def showSubtitleMissed(self, indexer_id, whichSubs):
|
||||||
@ -2714,7 +2713,7 @@ class Manage(WebRoot):
|
|||||||
show = sickbeard.helpers.findCertainShow(sickbeard.showList, int(cur_indexer_id))
|
show = sickbeard.helpers.findCertainShow(sickbeard.showList, int(cur_indexer_id))
|
||||||
subtitles = show.getEpisode(int(season), int(episode)).downloadSubtitles()
|
subtitles = show.getEpisode(int(season), int(episode)).downloadSubtitles()
|
||||||
|
|
||||||
self.redirect('/manage/subtitleMissed/')
|
return self.redirect('/manage/subtitleMissed/')
|
||||||
|
|
||||||
|
|
||||||
def backlogShow(self, indexer_id):
|
def backlogShow(self, indexer_id):
|
||||||
@ -2724,7 +2723,7 @@ class Manage(WebRoot):
|
|||||||
if show_obj:
|
if show_obj:
|
||||||
sickbeard.backlogSearchScheduler.action.searchBacklog([show_obj]) # @UndefinedVariable
|
sickbeard.backlogSearchScheduler.action.searchBacklog([show_obj]) # @UndefinedVariable
|
||||||
|
|
||||||
self.redirect("/manage/backlogOverview/")
|
return self.redirect("/manage/backlogOverview/")
|
||||||
|
|
||||||
|
|
||||||
def backlogOverview(self):
|
def backlogOverview(self):
|
||||||
@ -2775,7 +2774,7 @@ class Manage(WebRoot):
|
|||||||
t.submenu = self.ManageMenu()
|
t.submenu = self.ManageMenu()
|
||||||
|
|
||||||
if not toEdit:
|
if not toEdit:
|
||||||
self.redirect("/manage/")
|
return self.redirect("/manage/")
|
||||||
|
|
||||||
showIDs = toEdit.split("|")
|
showIDs = toEdit.split("|")
|
||||||
showList = []
|
showList = []
|
||||||
@ -2996,7 +2995,7 @@ class Manage(WebRoot):
|
|||||||
ui.notifications.error('%d error%s while saving changes:' % (len(errors), "" if len(errors) == 1 else "s"),
|
ui.notifications.error('%d error%s while saving changes:' % (len(errors), "" if len(errors) == 1 else "s"),
|
||||||
" ".join(errors))
|
" ".join(errors))
|
||||||
|
|
||||||
self.redirect("/manage/")
|
return self.redirect("/manage/")
|
||||||
|
|
||||||
|
|
||||||
def massUpdate(self, toUpdate=None, toRefresh=None, toRename=None, toDelete=None, toRemove=None, toMetadata=None,
|
def massUpdate(self, toUpdate=None, toRefresh=None, toRename=None, toDelete=None, toRemove=None, toMetadata=None,
|
||||||
@ -3116,7 +3115,7 @@ class Manage(WebRoot):
|
|||||||
ui.notifications.message("The following actions were queued:",
|
ui.notifications.message("The following actions were queued:",
|
||||||
messageDetail)
|
messageDetail)
|
||||||
|
|
||||||
self.redirect("/manage/")
|
return self.redirect("/manage/")
|
||||||
|
|
||||||
|
|
||||||
def manageTorrents(self):
|
def manageTorrents(self):
|
||||||
@ -3160,7 +3159,7 @@ class Manage(WebRoot):
|
|||||||
myDB.action('DELETE FROM failed WHERE release = ?', [release])
|
myDB.action('DELETE FROM failed WHERE release = ?', [release])
|
||||||
|
|
||||||
if toRemove:
|
if toRemove:
|
||||||
self.redirect('/manage/failedDownloads/')
|
return self.redirect('/manage/failedDownloads/')
|
||||||
|
|
||||||
t = PageTemplate(rh=self, file="manage_failedDownloads.tmpl")
|
t = PageTemplate(rh=self, file="manage_failedDownloads.tmpl")
|
||||||
t.failedResults = sqlResults
|
t.failedResults = sqlResults
|
||||||
@ -3192,7 +3191,7 @@ class ManageSearches(Manage):
|
|||||||
logger.log(u"Backlog search forced")
|
logger.log(u"Backlog search forced")
|
||||||
ui.notifications.message('Backlog search started')
|
ui.notifications.message('Backlog search started')
|
||||||
|
|
||||||
self.redirect("/manage/manageSearches/")
|
return self.redirect("/manage/manageSearches/")
|
||||||
|
|
||||||
def forceSearch(self):
|
def forceSearch(self):
|
||||||
|
|
||||||
@ -3202,7 +3201,7 @@ class ManageSearches(Manage):
|
|||||||
logger.log(u"Daily search forced")
|
logger.log(u"Daily search forced")
|
||||||
ui.notifications.message('Daily search started')
|
ui.notifications.message('Daily search started')
|
||||||
|
|
||||||
self.redirect("/manage/manageSearches/")
|
return self.redirect("/manage/manageSearches/")
|
||||||
|
|
||||||
|
|
||||||
def forceFindPropers(self):
|
def forceFindPropers(self):
|
||||||
@ -3213,7 +3212,7 @@ class ManageSearches(Manage):
|
|||||||
logger.log(u"Find propers search forced")
|
logger.log(u"Find propers search forced")
|
||||||
ui.notifications.message('Find propers search started')
|
ui.notifications.message('Find propers search started')
|
||||||
|
|
||||||
self.redirect("/manage/manageSearches/")
|
return self.redirect("/manage/manageSearches/")
|
||||||
|
|
||||||
|
|
||||||
def pauseBacklog(self, paused=None):
|
def pauseBacklog(self, paused=None):
|
||||||
@ -3222,7 +3221,7 @@ class ManageSearches(Manage):
|
|||||||
else:
|
else:
|
||||||
sickbeard.searchQueueScheduler.action.unpause_backlog() # @UndefinedVariable
|
sickbeard.searchQueueScheduler.action.unpause_backlog() # @UndefinedVariable
|
||||||
|
|
||||||
self.redirect("/manage/manageSearches/")
|
return self.redirect("/manage/manageSearches/")
|
||||||
|
|
||||||
|
|
||||||
@route('/history/(.*)(/?)')
|
@route('/history/(.*)(/?)')
|
||||||
@ -3304,7 +3303,7 @@ class History(WebRoot):
|
|||||||
myDB.action("DELETE FROM history WHERE 1=1")
|
myDB.action("DELETE FROM history WHERE 1=1")
|
||||||
|
|
||||||
ui.notifications.message('History cleared')
|
ui.notifications.message('History cleared')
|
||||||
self.redirect("/history/")
|
return self.redirect("/history/")
|
||||||
|
|
||||||
|
|
||||||
def trimHistory(self):
|
def trimHistory(self):
|
||||||
@ -3314,7 +3313,7 @@ class History(WebRoot):
|
|||||||
(datetime.datetime.today() - datetime.timedelta(days=30)).strftime(history.dateFormat)))
|
(datetime.datetime.today() - datetime.timedelta(days=30)).strftime(history.dateFormat)))
|
||||||
|
|
||||||
ui.notifications.message('Removed history entries greater than 30 days old')
|
ui.notifications.message('Removed history entries greater than 30 days old')
|
||||||
self.redirect("/history/")
|
return self.redirect("/history/")
|
||||||
|
|
||||||
|
|
||||||
@route('/config/(.*)(/?)')
|
@route('/config/(.*)(/?)')
|
||||||
@ -3472,7 +3471,7 @@ class ConfigGeneral(Config):
|
|||||||
else:
|
else:
|
||||||
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
||||||
|
|
||||||
self.redirect("/config/general/")
|
return self.redirect("/config/general/")
|
||||||
|
|
||||||
|
|
||||||
@route('/config/backuprestore/(.*)(/?)')
|
@route('/config/backuprestore/(.*)(/?)')
|
||||||
@ -3613,7 +3612,7 @@ class ConfigSearch(Config):
|
|||||||
else:
|
else:
|
||||||
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
||||||
|
|
||||||
self.redirect("/config/search/")
|
return self.redirect("/config/search/")
|
||||||
|
|
||||||
|
|
||||||
@route('/config/postProcessing/(.*)(/?)')
|
@route('/config/postProcessing/(.*)(/?)')
|
||||||
@ -3746,7 +3745,7 @@ class ConfigPostProcessing(Config):
|
|||||||
else:
|
else:
|
||||||
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
||||||
|
|
||||||
self.redirect("/config/postProcessing/")
|
return self.redirect("/config/postProcessing/")
|
||||||
|
|
||||||
def testNaming(self, pattern=None, multi=None, abd=False, sports=False, anime_type=None):
|
def testNaming(self, pattern=None, multi=None, abd=False, sports=False, anime_type=None):
|
||||||
|
|
||||||
@ -4252,7 +4251,7 @@ class ConfigProviders(Config):
|
|||||||
else:
|
else:
|
||||||
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
||||||
|
|
||||||
self.redirect("/config/providers/")
|
return self.redirect("/config/providers/")
|
||||||
|
|
||||||
|
|
||||||
@route('/config/notifications/(.*)(/?)')
|
@route('/config/notifications/(.*)(/?)')
|
||||||
@ -4462,7 +4461,7 @@ class ConfigNotifications(Config):
|
|||||||
else:
|
else:
|
||||||
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
||||||
|
|
||||||
self.redirect("/config/notifications/")
|
return self.redirect("/config/notifications/")
|
||||||
|
|
||||||
|
|
||||||
@route('/config/subtitles/(.*)(/?)')
|
@route('/config/subtitles/(.*)(/?)')
|
||||||
@ -4526,7 +4525,7 @@ class ConfigSubtitles(Config):
|
|||||||
else:
|
else:
|
||||||
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
||||||
|
|
||||||
self.redirect("/config/subtitles/")
|
return self.redirect("/config/subtitles/")
|
||||||
|
|
||||||
|
|
||||||
@route('/config/anime/(.*)(/?)')
|
@route('/config/anime/(.*)(/?)')
|
||||||
@ -4559,7 +4558,7 @@ class ConfigAnime(Config):
|
|||||||
else:
|
else:
|
||||||
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
||||||
|
|
||||||
self.redirect("/config/anime/")
|
return self.redirect("/config/anime/")
|
||||||
|
|
||||||
|
|
||||||
@route('/errorlogs/(.*)(/?)')
|
@route('/errorlogs/(.*)(/?)')
|
||||||
@ -4582,7 +4581,7 @@ class ErrorLogs(WebRoot):
|
|||||||
|
|
||||||
def clearerrors(self):
|
def clearerrors(self):
|
||||||
classes.ErrorViewer.clear()
|
classes.ErrorViewer.clear()
|
||||||
self.redirect("/errorlogs/")
|
return self.redirect("/errorlogs/")
|
||||||
|
|
||||||
|
|
||||||
def viewlog(self, minLevel=logger.MESSAGE, maxLines=500):
|
def viewlog(self, minLevel=logger.MESSAGE, maxLines=500):
|
||||||
|
Loading…
Reference in New Issue
Block a user