From cf4cbd9a34f5cefbb90ff0f8d863cb0c7e19414d Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 18 Jun 2014 01:53:11 -0700 Subject: [PATCH 1/4] Fix for missing WITH statement --- SickBeard.py | 2 ++ sickbeard/webserveInit.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SickBeard.py b/SickBeard.py index 79267797..9c182bef 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -18,6 +18,8 @@ # along with SickRage. If not, see . # Check needed software dependencies to nudge users to fix their setup +from __future__ import with_statement + import sys if sys.version_info < (2, 6): diff --git a/sickbeard/webserveInit.py b/sickbeard/webserveInit.py index f333d845..1f90ecb5 100644 --- a/sickbeard/webserveInit.py +++ b/sickbeard/webserveInit.py @@ -114,6 +114,8 @@ def initWebServer(options={}): app.add_handlers(".*$", [ (r'%s/(favicon\.ico)' % options['web_root'], MultiStaticFileHandler, {'paths': [os.path.join(options['data_root'], 'images/ico/favicon.ico')]}), + (r'%s/(.*)(/?)' % options['web_root'], MultiStaticFileHandler, + {'paths': [options['data_root']]}), (r'%s/%s/(.*)(/?)' % (options['web_root'], 'images'), MultiStaticFileHandler, {'paths': [os.path.join(options['data_root'], 'images'), os.path.join(sickbeard.CACHE_DIR, 'images'), @@ -121,7 +123,9 @@ def initWebServer(options={}): (r'%s/%s/(.*)(/?)' % (options['web_root'], 'css'), MultiStaticFileHandler, {'paths': [os.path.join(options['data_root'], 'css')]}), (r'%s/%s/(.*)(/?)' % (options['web_root'], 'js'), MultiStaticFileHandler, - {'paths': [os.path.join(options['data_root'], 'js')]}) + {'paths': [os.path.join(options['data_root'], 'js'), + os.path.join(options['data_root'], 'js/lib'), + os.path.join(options['data_root'], 'js/fancybox')]}) ]) From c9f800128ef8e22c840b6c131b075d9c4cc63376 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 18 Jun 2014 02:04:02 -0700 Subject: [PATCH 2/4] Fix for force update. --- sickbeard/webserve.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 701606fb..93a4ea71 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3277,14 +3277,12 @@ class Home(IndexHandler): if str(pid) != str(sickbeard.PID): self.redirect("/home/") - # auto-reload - tornado.autoreload.start(IOLoop.current()) - updated = sickbeard.versionCheckScheduler.action.update() # @UndefinedVariable - if updated: # do a hard restart - #threading.Timer(2, sickbeard.invoke_restart, [False]).start() + if not sickbeard.AUTO_UPDATE: + threading.Timer(2, sickbeard.invoke_restart, [False]).start() + t = PageTemplate(file="restart_bare.tmpl") return _munge(t) else: From 29c5c4de4d9be73f64320d0c1447574c7f83038d Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 18 Jun 2014 02:13:22 -0700 Subject: [PATCH 3/4] Fixed issue of forbidden error --- sickbeard/webserve.py | 2 +- sickbeard/webserveInit.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 93a4ea71..86bdf6f9 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3282,7 +3282,7 @@ class Home(IndexHandler): # do a hard restart if not sickbeard.AUTO_UPDATE: threading.Timer(2, sickbeard.invoke_restart, [False]).start() - + t = PageTemplate(file="restart_bare.tmpl") return _munge(t) else: diff --git a/sickbeard/webserveInit.py b/sickbeard/webserveInit.py index 1f90ecb5..1282e7dd 100644 --- a/sickbeard/webserveInit.py +++ b/sickbeard/webserveInit.py @@ -114,8 +114,6 @@ def initWebServer(options={}): app.add_handlers(".*$", [ (r'%s/(favicon\.ico)' % options['web_root'], MultiStaticFileHandler, {'paths': [os.path.join(options['data_root'], 'images/ico/favicon.ico')]}), - (r'%s/(.*)(/?)' % options['web_root'], MultiStaticFileHandler, - {'paths': [options['data_root']]}), (r'%s/%s/(.*)(/?)' % (options['web_root'], 'images'), MultiStaticFileHandler, {'paths': [os.path.join(options['data_root'], 'images'), os.path.join(sickbeard.CACHE_DIR, 'images'), From 652de9172b435843f8f8c9a32b60be61aa4b3789 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 18 Jun 2014 02:16:14 -0700 Subject: [PATCH 4/4] Testing force update --- sickbeard/webserveInit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sickbeard/webserveInit.py b/sickbeard/webserveInit.py index 1282e7dd..61cd31ca 100644 --- a/sickbeard/webserveInit.py +++ b/sickbeard/webserveInit.py @@ -103,7 +103,7 @@ def initWebServer(options={}): cookie_secret='61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=' ) - # Index Handler + # Main Handler app.add_handlers(".*$", [ (r"/", RedirectHandler, {'url': '%s/home/' % options['web_root']}), (r'%s/api/(.*)(/?)' % options['web_root'], webapi.Api),