Quiet webservice

This commit is contained in:
angelblue05 2019-01-14 17:49:58 -06:00
parent ae51eabb41
commit d555079221

View file

@ -111,6 +111,12 @@ class StoppableHttpRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
except Exception: except Exception:
pass pass
def log_message(self, format, *args):
''' Mute the webservice requests.
'''
pass
def do_QUIT(self): def do_QUIT(self):
''' send 200 OK response, and set server.stop to True ''' send 200 OK response, and set server.stop to True
@ -159,18 +165,22 @@ class StoppableHttpRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
try: try:
params = self.get_params() params = self.get_params()
LOG.info("Webservice called with params: %s", params) LOG.info("Webservice called with params: %s", params)
path = ("plugin://plugin.video.emby?mode=play&id=%s&dbid=%s&filename=%s&transcode=%s" 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)) % (params.get('Id'), params.get('KodiId'), params.get('Name'), params.get('transcode') or False))
self.send_response(200) self.send_response(200)
self.send_header('Content-type', 'text/html') self.send_header('Content-type', 'text/html')
self.send_header('Content-Length', len(path)) self.send_header('Content-Length', len(path))
self.end_headers() self.end_headers()
if not headers_only:
self.wfile.write(path) self.wfile.write(path)
except Exception as error: except Exception as error:
LOG.exception(error) LOG.exception(error)
self.send_error(500, 'Exception occurred: %s' % error) self.send_error(500, "Exception occurred: %s" % error)
return return