From 9a9bc9f0eb3197d82f6566d41f3617b7b7c2680c Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 13 Apr 2019 14:18:13 +0200 Subject: [PATCH] Optimize code --- resources/lib/webservice.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/lib/webservice.py b/resources/lib/webservice.py index 9d192a21..2966ca7c 100644 --- a/resources/lib/webservice.py +++ b/resources/lib/webservice.py @@ -158,7 +158,8 @@ class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): def handle_request(self, headers_only=False): '''Send headers and reponse ''' - xbmc.log('Plex.WebService handle_request called. path: %s ]' % self.path, xbmc.LOGWARNING) + xbmc.log('Plex.WebService handle_request called. headers %s, path: %s' + % (headers_only, self.path), xbmc.LOGWARNING) try: if b'extrafanart' in self.path or b'extrathumbs' in self.path: raise Exception('unsupported artwork request') @@ -170,10 +171,8 @@ class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): elif b'file.strm' not in self.path: self.images() - elif b'file.strm' in self.path: - self.strm() else: - xbmc.log(str(self.path), xbmc.LOGWARNING) + self.strm() except Exception as error: self.send_error(500,