From 1145f90208afb4fa8bec731a112826c1239cf11c Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 29 Jun 2014 19:39:29 -0700 Subject: [PATCH] Disabled caching for notification tests. --- sickbeard/webserve.py | 47 +++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 76120f3e..06705839 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3049,6 +3049,7 @@ class Home(MainHandler): else: return "Error: Unsupported Request. Send jsonp request with 'callback' variable in the query string." + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') self.set_header('Content-Type', 'text/javascript') self.set_header('Access-Control-Allow-Origin', '*') self.set_header('Access-Control-Allow-Headers', 'x-requested-with') @@ -3083,6 +3084,7 @@ class Home(MainHandler): postprocess = HomePostProcess def testSABnzbd(self, host=None, username=None, password=None, apikey=None): + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_url(host) @@ -3098,6 +3100,7 @@ class Home(MainHandler): def testTorrent(self, torrent_method=None, host=None, username=None, password=None): + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_url(host) @@ -3109,7 +3112,7 @@ class Home(MainHandler): def testGrowl(self, host=None, password=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_host(host, default_port=23053) @@ -3126,7 +3129,7 @@ class Home(MainHandler): def testProwl(self, prowl_api=None, prowl_priority=0): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.prowl_notifier.test_notify(prowl_api, prowl_priority) if result: @@ -3136,7 +3139,7 @@ class Home(MainHandler): def testBoxcar(self, username=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.boxcar_notifier.test_notify(username) if result: @@ -3146,7 +3149,7 @@ class Home(MainHandler): def testBoxcar2(self, accesstoken=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.boxcar2_notifier.test_notify(accesstoken) if result: @@ -3156,7 +3159,7 @@ class Home(MainHandler): def testPushover(self, userKey=None, apiKey=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.pushover_notifier.test_notify(userKey, apiKey) if result: @@ -3166,13 +3169,13 @@ class Home(MainHandler): def twitterStep1(self, *args, **kwargs): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') return notifiers.twitter_notifier._get_authorization() def twitterStep2(self, key): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.twitter_notifier._get_credentials(key) logger.log(u"result: " + str(result)) @@ -3183,7 +3186,7 @@ class Home(MainHandler): def testTwitter(self, *args, **kwargs): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.twitter_notifier.test_notify() if result: @@ -3193,7 +3196,7 @@ class Home(MainHandler): def testXBMC(self, host=None, username=None, password=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_hosts(host) finalResult = '' @@ -3209,7 +3212,7 @@ class Home(MainHandler): def testPLEX(self, host=None, username=None, password=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') finalResult = '' for curHost in [x.strip() for x in host.split(",")]: @@ -3224,7 +3227,7 @@ class Home(MainHandler): def testLibnotify(self, *args, **kwargs): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') if notifiers.libnotify_notifier.test_notify(): return "Tried sending desktop notification via libnotify" @@ -3233,7 +3236,7 @@ class Home(MainHandler): def testNMJ(self, host=None, database=None, mount=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_host(host) result = notifiers.nmj_notifier.test_notify(urllib.unquote_plus(host), database, mount) @@ -3244,7 +3247,7 @@ class Home(MainHandler): def settingsNMJ(self, host=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_host(host) result = notifiers.nmj_notifier.notify_settings(urllib.unquote_plus(host)) @@ -3256,7 +3259,7 @@ class Home(MainHandler): def testNMJv2(self, host=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_host(host) result = notifiers.nmjv2_notifier.test_notify(urllib.unquote_plus(host)) @@ -3267,7 +3270,7 @@ class Home(MainHandler): def settingsNMJv2(self, host=None, dbloc=None, instance=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_host(host) result = notifiers.nmjv2_notifier.notify_settings(urllib.unquote_plus(host), dbloc, instance) @@ -3280,7 +3283,7 @@ class Home(MainHandler): def testTrakt(self, api=None, username=None, password=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.trakt_notifier.test_notify(api, username, password) if result: @@ -3290,7 +3293,7 @@ class Home(MainHandler): def loadShowNotifyLists(self, *args, **kwargs): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') myDB = db.DBConnection() rows = myDB.select("SELECT show_id, show_name, notify_list FROM tv_shows ORDER BY show_name ASC") @@ -3305,7 +3308,7 @@ class Home(MainHandler): def testEmail(self, host=None, port=None, smtp_from=None, use_tls=None, user=None, pwd=None, to=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') host = config.clean_host(host) if notifiers.email_notifier.test_notify(host, port, smtp_from, use_tls, user, pwd, to): @@ -3315,7 +3318,7 @@ class Home(MainHandler): def testNMA(self, nma_api=None, nma_priority=0): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.nma_notifier.test_notify(nma_api, nma_priority) if result: @@ -3325,7 +3328,7 @@ class Home(MainHandler): def testPushalot(self, authorizationToken=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.pushalot_notifier.test_notify(authorizationToken) if result: @@ -3335,7 +3338,7 @@ class Home(MainHandler): def testPushbullet(self, api=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.pushbullet_notifier.test_notify(api) if result: @@ -3345,7 +3348,7 @@ class Home(MainHandler): def getPushbulletDevices(self, api=None): - + self.set_header('Cache-Control', 'max-age=0,no-cache,no-store') result = notifiers.pushbullet_notifier.get_devices(api) if result: