From e5ac585b6aec08f9681f6f5840c0a26aafb8f6cf Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 23 Jul 2014 23:36:44 -0700 Subject: [PATCH] Fix for webui becoming unresponsive when using SSL and possibly in other situations as well. --- SickBeard.py | 4 ++-- sickbeard/helpers.py | 2 -- sickbeard/metadata/generic.py | 8 +++++--- sickbeard/webserveInit.py | 5 ++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/SickBeard.py b/SickBeard.py index ec364a11..3c35ad92 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -332,8 +332,8 @@ class SickRage(object): 'password': sickbeard.WEB_PASSWORD, 'enable_https': sickbeard.ENABLE_HTTPS, 'handle_reverse_proxy': sickbeard.HANDLE_REVERSE_PROXY, - 'https_cert': sickbeard.HTTPS_CERT, - 'https_key': sickbeard.HTTPS_KEY, + 'https_cert': os.path.join(sickbeard.PROG_DIR, sickbeard.HTTPS_CERT), + 'https_key': os.path.join(sickbeard.PROG_DIR, sickbeard.HTTPS_KEY), } # start web server diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 82ceca5d..10a260f9 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -807,13 +807,11 @@ def create_https_certificates(ssl_cert, ssl_key): return True - if __name__ == '__main__': import doctest doctest.testmod() - def parse_json(data): """ Parse json data into a python object diff --git a/sickbeard/metadata/generic.py b/sickbeard/metadata/generic.py index 217a6d3f..4234404d 100644 --- a/sickbeard/metadata/generic.py +++ b/sickbeard/metadata/generic.py @@ -275,14 +275,15 @@ class GenericMetadata(): def update_show_indexer_metadata(self, show_obj): if self.show_metadata and show_obj and self._has_show_metadata(show_obj): - logger.log(u"Metadata provider " + self.name + " updating show indexer info metadata file for " + show_obj.name, logger.DEBUG) + logger.log( + u"Metadata provider " + self.name + " updating show indexer info metadata file for " + show_obj.name, + logger.DEBUG) nfo_file_path = self.get_show_file_path(show_obj) try: with ek.ek(open, nfo_file_path, 'r') as xmlFileObj: showXML = etree.ElementTree(file=xmlFileObj) - indexer = showXML.find('indexer') indexerid = showXML.find('id') @@ -976,7 +977,8 @@ class GenericMetadata(): try: search = tmdb.Search() for show_name in set(allPossibleShowNames(show)): - for result in search.collection({'query': show_name})['results'] + search.tv({'query': show_name})['results']: + for result in search.collection({'query': show_name})['results'] + search.tv({'query': show_name})[ + 'results']: if backdrop and result['backdrop_path']: return "{0}{1}{2}".format(base_url, max_size, result['backdrop_path']) elif poster and result['poster_path']: diff --git a/sickbeard/webserveInit.py b/sickbeard/webserveInit.py index c9124ebd..edd48a81 100644 --- a/sickbeard/webserveInit.py +++ b/sickbeard/webserveInit.py @@ -123,11 +123,10 @@ class SRWebServer(threading.Thread): def run(self): if self.enable_https: protocol = "https" - self.server = HTTPServer(self.app, no_keep_alive=True, - ssl_options={"certfile": self.https_cert, "keyfile": self.https_key}) + self.server = HTTPServer(self.app, ssl_options={"certfile": self.https_cert, "keyfile": self.https_key}) else: protocol = "http" - self.server = HTTPServer(self.app, no_keep_alive=True) + self.server = HTTPServer(self.app) logger.log(u"Starting SickRage on " + protocol + "://" + str(self.options['host']) + ":" + str( self.options['port']) + "/")