diff --git a/SickBeard.py b/SickBeard.py
index afdf45c3..1242ae88 100755
--- a/SickBeard.py
+++ b/SickBeard.py
@@ -257,7 +257,7 @@ def main():
sys.exit("PID file: " + sickbeard.PIDFILE + " already exists. Exiting.")
# The pidfile is only useful in daemon mode, make sure we can write the file properly
- if sickbeard.CREATEPID:
+ if sickbeard.CREATEPID and not sickbeard.restarted:
if sickbeard.DAEMON:
pid_dir = os.path.dirname(sickbeard.PIDFILE)
if not os.access(pid_dir, os.F_OK):
diff --git a/gui/slick/interfaces/default/config_notifications.tmpl b/gui/slick/interfaces/default/config_notifications.tmpl
index 49bda830..1f9d4a96 100644
--- a/gui/slick/interfaces/default/config_notifications.tmpl
+++ b/gui/slick/interfaces/default/config_notifications.tmpl
@@ -1184,6 +1184,13 @@
Get your key at: http://trakt.tv/settings/api
+
+
+
+ Sync Libraries:
+ Syncs SickRage's show library with your trakt.tv show library
+
+
diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py
index a19026c0..0c95bb38 100644
--- a/sickbeard/__init__.py
+++ b/sickbeard/__init__.py
@@ -355,6 +355,7 @@ TRAKT_USE_WATCHLIST = False
TRAKT_METHOD_ADD = 0
TRAKT_START_PAUSED = False
TRAKT_USE_RECOMMENDED = False
+TRAKT_SYNC = False
USE_PYTIVO = False
PYTIVO_NOTIFY_ONSNATCH = False
@@ -445,7 +446,7 @@ def initialize(consoleLogging=True):
TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, TORRENT_VERIFY_CERT, \
USE_XBMC, XBMC_ALWAYS_ON, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \
XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, BACKLOG_FREQUENCY, \
- USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktCheckerScheduler, TRAKT_USE_RECOMMENDED, \
+ USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktCheckerScheduler, TRAKT_USE_RECOMMENDED, TRAKT_SYNC, \
USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \
PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \
showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, UPDATE_SHOWS_ON_START, SORT_ARTICLE, showList, loadingShowList, \
@@ -794,6 +795,7 @@ def initialize(consoleLogging=True):
TRAKT_METHOD_ADD = check_setting_str(CFG, 'Trakt', 'trakt_method_add', "0")
TRAKT_START_PAUSED = bool(check_setting_int(CFG, 'Trakt', 'trakt_start_paused', 0))
TRAKT_USE_RECOMMENDED = bool(check_setting_int(CFG, 'Trakt', 'trakt_use_recommended', 0))
+ TRAKT_SYNC = bool(check_setting_int(CFG, 'Trakt', 'trakt_sync', 0))
CheckSection(CFG, 'pyTivo')
USE_PYTIVO = bool(check_setting_int(CFG, 'pyTivo', 'use_pytivo', 0))
@@ -1668,6 +1670,7 @@ def save_config():
new_config['Trakt']['trakt_method_add'] = TRAKT_METHOD_ADD
new_config['Trakt']['trakt_start_paused'] = int(TRAKT_START_PAUSED)
new_config['Trakt']['trakt_use_recommended'] = int(TRAKT_USE_RECOMMENDED)
+ new_config['Trakt']['trakt_sync'] = int(TRAKT_SYNC)
new_config['pyTivo'] = {}
new_config['pyTivo']['use_pytivo'] = int(USE_PYTIVO)
diff --git a/sickbeard/show_queue.py b/sickbeard/show_queue.py
index 7a3b3b94..35e9f13b 100644
--- a/sickbeard/show_queue.py
+++ b/sickbeard/show_queue.py
@@ -390,7 +390,8 @@ class QueueItemAdd(ShowQueueItem):
sickbeard.traktCheckerScheduler.action.manageNewShow(self.show)
# add show to trakt.tv library
- sickbeard.traktCheckerScheduler.action.addShowToTraktLibrary(self.show)
+ if sickbeard.TRAKT_SYNC:
+ sickbeard.traktCheckerScheduler.action.addShowToTraktLibrary(self.show)
# Load XEM data to DB for show
sickbeard.scene_numbering.xem_refresh(self.show.indexerid, self.show.indexer, force=True)
diff --git a/sickbeard/traktChecker.py b/sickbeard/traktChecker.py
index 0fa7cf3e..a33ef817 100644
--- a/sickbeard/traktChecker.py
+++ b/sickbeard/traktChecker.py
@@ -44,7 +44,7 @@ class TraktChecker():
self.updateEpisodes()
# sync trakt.tv library with sickrage library
- if sickbeard.TRAKT_USE_RECOMMENDED:
+ if sickbeard.TRAKT_SYNC:
self.syncLibrary()
def findShow(self, indexerid):
diff --git a/sickbeard/tvcache.py b/sickbeard/tvcache.py
index 06137dfe..5de6cb68 100644
--- a/sickbeard/tvcache.py
+++ b/sickbeard/tvcache.py
@@ -61,8 +61,8 @@ class CacheDBConnection(db.DBConnection):
for cur_dupe in sqlResults:
self.action("DELETE FROM [" + providerName + "] WHERE url = ?", [cur_dupe["url"]])
- # add unique index to prevent further dupes from happening if one does not exist
- self.action("CREATE UNIQUE INDEX IF NOT EXISTS idx_url ON " + providerName + " (url)")
+ # add unique index to prevent further dupes from happening if one does not exist
+ self.action("CREATE UNIQUE INDEX IF NOT EXISTS idx_url ON " + providerName + " (url)")
except Exception, e:
if str(e) != "table [" + providerName + "] already exists":
raise
diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index 1f4ff7f8..3805caf6 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -19,6 +19,7 @@
from __future__ import with_statement
import base64
import inspect
+import urlparse
import zipfile
import os.path
@@ -80,7 +81,6 @@ except ImportError:
from lib import adba
from Cheetah.Template import Template
-from tornado import gen
from tornado.web import RequestHandler, HTTPError, asynchronous
req_headers = None
@@ -155,11 +155,11 @@ class MainHandler(RequestHandler):
def http_error_404_handler(self):
""" Custom handler for 404 error, redirect back to main page """
- return self.redirect('/home/')
+ return self.redirectTo('/home/')
def write_error(self, status_code, **kwargs):
if status_code == 404:
- return self.redirect('/home/')
+ return self.redirectTo('/home/')
elif status_code == 401:
self.finish(self.http_error_401_handler())
else:
@@ -208,17 +208,20 @@ class MainHandler(RequestHandler):
raise HTTPError(404)
- def redirect(self, url, permanent=False, status=None):
+ def redirectTo(self, url):
self._transforms = []
- return super(MainHandler, self).redirect(sickbeard.WEB_ROOT + url, True, 303)
+
+ url = urlparse.urljoin(sickbeard.WEB_ROOT, url)
+ logger.log(u"Redirecting to: " + url, logger.DEBUG)
+
+ self.redirect(url, status=303)
def get(self, *args, **kwargs):
response = self._dispatch()
self.finish(response)
def post(self, *args, **kwargs):
- response = self._dispatch()
- self.finish(response)
+ self._dispatch()
def robots_txt(self, *args, **kwargs):
""" Keep web crawlers out """
@@ -260,7 +263,7 @@ class MainHandler(RequestHandler):
sickbeard.HOME_LAYOUT = layout
- return self.redirect("/home/")
+ return self.redirectTo("/home/")
def setHistoryLayout(self, layout):
@@ -269,13 +272,13 @@ class MainHandler(RequestHandler):
sickbeard.HISTORY_LAYOUT = layout
- return self.redirect("/history/")
+ return self.redirectTo("/history/")
def toggleDisplayShowSpecials(self, show):
sickbeard.DISPLAY_SHOW_SPECIALS = not sickbeard.DISPLAY_SHOW_SPECIALS
- return self.redirect("/home/displayShow?show=" + show)
+ return self.redirectTo("/home/displayShow?show=" + show)
def setComingEpsLayout(self, layout):
if layout not in ('poster', 'banner', 'list'):
@@ -283,13 +286,13 @@ class MainHandler(RequestHandler):
sickbeard.COMING_EPS_LAYOUT = layout
- return self.redirect("/comingEpisodes/")
+ return self.redirectTo("/comingEpisodes/")
def toggleComingEpsDisplayPaused(self, *args, **kwargs):
sickbeard.COMING_EPS_DISPLAY_PAUSED = not sickbeard.COMING_EPS_DISPLAY_PAUSED
- return self.redirect("/comingEpisodes/")
+ return self.redirectTo("/comingEpisodes/")
def setComingEpsSort(self, sort):
if sort not in ('date', 'network', 'show'):
@@ -297,7 +300,7 @@ class MainHandler(RequestHandler):
sickbeard.COMING_EPS_SORT = sort
- return self.redirect("/comingEpisodes/")
+ return self.redirectTo("/comingEpisodes/")
def comingEpisodes(self, layout="None"):
@@ -502,7 +505,7 @@ class IndexerWebUI(MainHandler):
showDirList = ""
for curShowDir in self.config['_showDir']:
showDirList += "showDir=" + curShowDir + "&"
- return self.redirect("/home/addShows/addShow?" + showDirList + "seriesList=" + searchList)
+ return self.redirectTo("/home/addShows/addShow?" + showDirList + "seriesList=" + searchList)
def _munge(string):
@@ -581,7 +584,7 @@ class ManageSearches(MainHandler):
logger.log(u"Backlog search forced")
ui.notifications.message('Backlog search started')
- return self.redirect("/manage/manageSearches/")
+ return self.redirectTo("/manage/manageSearches/")
def forceSearch(self, *args, **kwargs):
@@ -592,7 +595,7 @@ class ManageSearches(MainHandler):
logger.log(u"Daily search forced")
ui.notifications.message('Daily search started')
- return self.redirect("/manage/manageSearches/")
+ return self.redirectTo("/manage/manageSearches/")
def forceFindPropers(self, *args, **kwargs):
@@ -603,7 +606,7 @@ class ManageSearches(MainHandler):
logger.log(u"Find propers search forced")
ui.notifications.message('Find propers search started')
- return self.redirect("/manage/manageSearches/")
+ return self.redirectTo("/manage/manageSearches/")
def pauseBacklog(self, paused=None):
@@ -612,7 +615,7 @@ class ManageSearches(MainHandler):
else:
sickbeard.searchQueueScheduler.action.unpause_backlog() # @UndefinedVariable
- return self.redirect("/manage/manageSearches/")
+ return self.redirectTo("/manage/manageSearches/")
class Manage(MainHandler):
@@ -726,7 +729,7 @@ class Manage(MainHandler):
Home(self.application, self.request).setStatus(cur_indexer_id, '|'.join(to_change[cur_indexer_id]),
newStatus, direct=True)
- return self.redirect('/manage/episodeStatuses/')
+ return self.redirectTo('/manage/episodeStatuses/')
def showSubtitleMissed(self, indexer_id, whichSubs):
@@ -834,7 +837,7 @@ class Manage(MainHandler):
show = sickbeard.helpers.findCertainShow(sickbeard.showList, int(cur_indexer_id))
subtitles = show.getEpisode(int(season), int(episode)).downloadSubtitles()
- return self.redirect('/manage/subtitleMissed/')
+ return self.redirectTo('/manage/subtitleMissed/')
def backlogShow(self, indexer_id):
@@ -844,7 +847,7 @@ class Manage(MainHandler):
if show_obj:
sickbeard.backlogSearchScheduler.action.searchBacklog([show_obj]) # @UndefinedVariable
- return self.redirect("/manage/backlogOverview/")
+ return self.redirectTo("/manage/backlogOverview/")
def backlogOverview(self, *args, **kwargs):
@@ -895,7 +898,7 @@ class Manage(MainHandler):
t.submenu = ManageMenu()
if not toEdit:
- return self.redirect("/manage/")
+ return self.redirectTo("/manage/")
showIDs = toEdit.split("|")
showList = []
@@ -1062,7 +1065,7 @@ class Manage(MainHandler):
ui.notifications.error('%d error%s while saving changes:' % (len(errors), "" if len(errors) == 1 else "s"),
" ".join(errors))
- return self.redirect("/manage/")
+ return self.redirectTo("/manage/")
def massUpdate(self, toUpdate=None, toRefresh=None, toRename=None, toDelete=None, toMetadata=None, toSubtitle=None):
@@ -1171,7 +1174,7 @@ class Manage(MainHandler):
ui.notifications.message("The following actions were queued:",
messageDetail)
- return self.redirect("/manage/")
+ return self.redirectTo("/manage/")
def manageTorrents(self, *args, **kwargs):
@@ -1215,7 +1218,7 @@ class Manage(MainHandler):
myDB.action('DELETE FROM failed WHERE release = ?', [release])
if toRemove:
- raise self.redirect('/manage/failedDownloads/')
+ raise self.redirectTo('/manage/failedDownloads/')
t = PageTemplate(file="manage_failedDownloads.tmpl")
t.failedResults = sqlResults
@@ -1303,7 +1306,7 @@ class History(MainHandler):
myDB.action("DELETE FROM history WHERE 1=1")
ui.notifications.message('History cleared')
- return self.redirect("/history/")
+ return self.redirectTo("/history/")
def trimHistory(self, *args, **kwargs):
@@ -1313,7 +1316,7 @@ class History(MainHandler):
(datetime.datetime.today() - datetime.timedelta(days=30)).strftime(history.dateFormat)))
ui.notifications.message('Removed history entries greater than 30 days old')
- return self.redirect("/history/")
+ return self.redirectTo("/history/")
ConfigMenu = [
@@ -2177,7 +2180,7 @@ class ConfigNotifications(MainHandler):
use_nmjv2=None, nmjv2_host=None, nmjv2_dbloc=None, nmjv2_database=None,
use_trakt=None, trakt_username=None, trakt_password=None, trakt_api=None,
trakt_remove_watchlist=None, trakt_use_watchlist=None, trakt_method_add=None,
- trakt_start_paused=None, trakt_use_recommended=None,
+ trakt_start_paused=None, trakt_use_recommended=None, trakt_sync=None,
use_synologynotifier=None, synologynotifier_notify_onsnatch=None,
synologynotifier_notify_ondownload=None, synologynotifier_notify_onsubtitledownload=None,
use_pytivo=None, pytivo_notify_onsnatch=None, pytivo_notify_ondownload=None,
@@ -2289,6 +2292,7 @@ class ConfigNotifications(MainHandler):
sickbeard.TRAKT_METHOD_ADD = trakt_method_add
sickbeard.TRAKT_START_PAUSED = config.checkbox_to_value(trakt_start_paused)
sickbeard.TRAKT_USE_RECOMMENDED = config.checkbox_to_value(trakt_use_recommended)
+ sickbeard.TRAKT_SYNC = config.checkbox_to_value(trakt_sync)
if sickbeard.USE_TRAKT:
sickbeard.traktCheckerScheduler.silent = False
@@ -2510,7 +2514,7 @@ class HomePostProcess(MainHandler):
if sickbeard.versionCheckScheduler.action.check_for_new_version(force=True):
logger.log(u"Forcing version check")
- return self.redirect("/home/")
+ return self.redirectTo("/home/")
def processEpisode(self, dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None,
is_priority=None, failed="0", type="auto"):
@@ -2531,7 +2535,7 @@ class HomePostProcess(MainHandler):
is_priority = False
if not dir:
- return self.redirect("/home/postprocess/")
+ return self.redirectTo("/home/postprocess/")
else:
result = processTV.processDir(dir, nzbName, process_method=process_method, force=force,
is_priority=is_priority, failed=failed, type=type)
@@ -2761,16 +2765,13 @@ class NewHomeAddShows(MainHandler):
show_url = whichSeries.split('|')[1]
indexer_id = whichSeries.split('|')[0]
show_name = whichSeries.split('|')[2]
- first_aired = whichSeries.split('|')[4]
- self.addNewShow('|'.join([indexer_name, str(indexer), show_url, indexer_id, show_name, first_aired]),
+ return self.addNewShow('|'.join([indexer_name, str(indexer), show_url, indexer_id, show_name, ""]),
indexerLang, rootDir,
defaultStatus,
anyQualities, bestQualities, flatten_folders, subtitles, fullShowPath, other_shows,
skipShow, providedIndexer, anime, scene)
- return self.redirect('/home/')
-
def existingShows(self, *args, **kwargs):
"""
Prints out the page to add existing shows from a root dir
@@ -2799,7 +2800,7 @@ class NewHomeAddShows(MainHandler):
def finishAddShow():
# if there are no extra shows then go home
if not other_shows:
- return self.redirect('/home/')
+ return self.redirectTo('/home/')
# peel off the next one
next_show_dir = other_shows[0]
@@ -2824,7 +2825,7 @@ class NewHomeAddShows(MainHandler):
logger.log("Unable to add show due to show selection. Not anough arguments: %s" % (repr(series_pieces)),
logger.ERROR)
ui.notifications.error("Unknown error. Unable to add show due to problem with show selection.")
- return self.redirect('/home/addShows/existingShows/')
+ return self.redirectTo('/home/addShows/existingShows/')
indexer = int(series_pieces[1])
indexer_id = int(series_pieces[3])
show_name = series_pieces[4]
@@ -2846,7 +2847,7 @@ class NewHomeAddShows(MainHandler):
# 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:
ui.notifications.error("Unable to add show", "Folder " + show_dir + " exists already")
- return self.redirect('/home/addShows/existingShows/')
+ return self.redirectTo('/home/addShows/existingShows/')
# don't create show dir if config says not to
if sickbeard.ADD_SHOWS_WO_DIR:
@@ -2857,7 +2858,7 @@ class NewHomeAddShows(MainHandler):
logger.log(u"Unable to create the folder " + show_dir + ", can't add the show", logger.ERROR)
ui.notifications.error("Unable to add show",
"Unable to create the folder " + show_dir + ", can't add the show")
- return self.redirect("/home/")
+ return self.redirectTo("/home/")
else:
helpers.chmodAsParent(show_dir)
@@ -2962,7 +2963,7 @@ class NewHomeAddShows(MainHandler):
# if we're done then go home
if not dirs_only:
- return self.redirect('/home/')
+ return self.redirectTo('/home/')
# 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:])
@@ -2985,7 +2986,7 @@ class ErrorLogs(MainHandler):
def clearerrors(self, *args, **kwargs):
classes.ErrorViewer.clear()
- return self.redirect("/errorlogs/")
+ return self.redirectTo("/errorlogs/")
def viewlog(self, minLevel=logger.MESSAGE, maxLines=500):
@@ -3356,7 +3357,7 @@ class Home(MainHandler):
def shutdown(self, pid=None):
if str(pid) != str(sickbeard.PID):
- return self.redirect("/home/")
+ return self.redirectTo("/home/")
threading.Timer(2, sickbeard.invoke_shutdown).start()
@@ -3368,7 +3369,7 @@ class Home(MainHandler):
def restart(self, pid=None):
if str(pid) != str(sickbeard.PID):
- return self.redirect("/home/")
+ return self.redirectTo("/home/")
t = PageTemplate(file="restart.tmpl")
t.submenu = HomeMenu()
@@ -3382,7 +3383,7 @@ class Home(MainHandler):
def update(self, pid=None):
if str(pid) != str(sickbeard.PID):
- return self.redirect("/home/")
+ return self.redirectTo("/home/")
updated = sickbeard.versionCheckScheduler.action.update() # @UndefinedVariable
if updated:
@@ -3803,7 +3804,7 @@ class Home(MainHandler):
ui.notifications.error('%d error%s while saving changes:' % (len(errors), "" if len(errors) == 1 else "s"),
'' + '\n'.join(['%s ' % error for error in errors]) + " ")
- return self.redirect("/home/displayShow?show=" + show)
+ return self.redirectTo("/home/displayShow?show=" + show)
def deleteShow(self, show=None):
@@ -3820,14 +3821,14 @@ class Home(MainHandler):
showObj) or sickbeard.showQueueScheduler.action.isBeingUpdated(showObj): # @UndefinedVariable
return _genericMessage("Error", "Shows can't be deleted while they're being added or updated.")
- if sickbeard.USE_TRAKT:
+ if sickbeard.USE_TRAKT and sickbeard.TRAKT_SYNC:
# remove show from trakt.tv library
sickbeard.traktCheckerScheduler.action.removeShowFromTraktLibrary(showObj)
showObj.deleteShow()
ui.notifications.message('%s has been deleted' % showObj.name)
- return self.redirect("/home/")
+ return self.redirectTo("/home/")
def refreshShow(self, show=None):
@@ -3849,7 +3850,7 @@ class Home(MainHandler):
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
- return self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
+ return self.redirectTo("/home/displayShow?show=" + str(showObj.indexerid))
def updateShow(self, show=None, force=0):
@@ -3872,7 +3873,7 @@ class Home(MainHandler):
# just give it some time
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
- return self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
+ return self.redirectTo("/home/displayShow?show=" + str(showObj.indexerid))
def subtitleShow(self, show=None, force=0):
@@ -3890,7 +3891,7 @@ class Home(MainHandler):
time.sleep(cpu_presets[sickbeard.CPU_PRESET])
- return self.redirect("/home/displayShow?show=" + str(showObj.indexerid))
+ return self.redirectTo("/home/displayShow?show=" + str(showObj.indexerid))
def updateXBMC(self, showName=None):
@@ -3906,7 +3907,7 @@ class Home(MainHandler):
ui.notifications.message("Library update command sent to XBMC host(s): " + host)
else:
ui.notifications.error("Unable to contact one or more XBMC host(s): " + host)
- return self.redirect('/home/')
+ return self.redirectTo('/home/')
def updatePLEX(self, *args, **kwargs):
@@ -3915,7 +3916,7 @@ class Home(MainHandler):
"Library update command sent to Plex Media Server host: " + sickbeard.PLEX_SERVER_HOST)
else:
ui.notifications.error("Unable to contact Plex Media Server host: " + sickbeard.PLEX_SERVER_HOST)
- return self.redirect('/home/')
+ return self.redirectTo('/home/')
def setStatus(self, show=None, eps=None, status=None, direct=False):
@@ -4029,7 +4030,7 @@ class Home(MainHandler):
if direct:
return json.dumps({'result': 'success'})
else:
- return self.redirect("/home/displayShow?show=" + show)
+ return self.redirectTo("/home/displayShow?show=" + show)
def testRename(self, show=None):
@@ -4096,7 +4097,7 @@ class Home(MainHandler):
return _genericMessage("Error", "Can't rename episodes when the show dir is missing.")
if eps is None:
- return self.redirect("/home/displayShow?show=" + show)
+ return self.redirectTo("/home/displayShow?show=" + show)
myDB = db.DBConnection()
for curEp in eps.split('|'):
@@ -4123,7 +4124,7 @@ class Home(MainHandler):
root_ep_obj.rename()
- return self.redirect("/home/displayShow?show=" + show)
+ return self.redirectTo("/home/displayShow?show=" + show)
def searchEpisode(self, show=None, season=None, episode=None):
diff --git a/tornado/web.py b/tornado/web.py
index 96d0572f..4884dd67 100644
--- a/tornado/web.py
+++ b/tornado/web.py
@@ -1558,7 +1558,7 @@ def removeslash(method):
if uri: # don't try to redirect '/' to ''
if self.request.query:
uri += "?" + self.request.query
- self.redirect(uri, permanent=True)
+ self.redirectTo(uri, permanent=True)
return
else:
raise HTTPError(404)
@@ -1580,7 +1580,7 @@ def addslash(method):
uri = self.request.path + "/"
if self.request.query:
uri += "?" + self.request.query
- self.redirect(uri, permanent=True)
+ self.redirectTo(uri, permanent=True)
return
raise HTTPError(404)
return method(self, *args, **kwargs)
@@ -2587,7 +2587,7 @@ def authenticated(method):
else:
next_url = self.request.uri
url += "?" + urlencode(dict(next=next_url))
- self.redirect(url)
+ self.redirectTo(url)
return
raise HTTPError(403)
return method(self, *args, **kwargs)