From d555079221b9c5a4deaea5f5c4e35f9cdcd0dc57 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 14 Jan 2019 17:49:58 -0600 Subject: [PATCH] Quiet webservice --- resources/lib/webservice.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/lib/webservice.py b/resources/lib/webservice.py index e89a2803..5ef21824 100644 --- a/resources/lib/webservice.py +++ b/resources/lib/webservice.py @@ -111,6 +111,12 @@ class StoppableHttpRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): except Exception: pass + def log_message(self, format, *args): + + ''' Mute the webservice requests. + ''' + pass + def do_QUIT(self): ''' send 200 OK response, and set server.stop to True @@ -159,18 +165,22 @@ class StoppableHttpRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): try: params = self.get_params() LOG.info("Webservice called with params: %s", params) + path = ("plugin://plugin.video.emby?mode=play&id=%s&dbid=%s&filename=%s&transcode=%s" % (params.get('Id'), params.get('KodiId'), params.get('Name'), params.get('transcode') or False)) + self.send_response(200) self.send_header('Content-type', 'text/html') self.send_header('Content-Length', len(path)) self.end_headers() - self.wfile.write(path) + + if not headers_only: + self.wfile.write(path) except Exception as error: LOG.exception(error) - self.send_error(500, 'Exception occurred: %s' % error) + self.send_error(500, "Exception occurred: %s" % error) return