mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-07-28 17:26:31 +00:00
Cleanup __shortcuts__ in client.py and associated code (#66)
* client.py - remove "connected" * client.py - remove "config" & configuration.py - removed shortcuts and get/set item functions * client.py - remove "auth" & connection_manager.py - remove __shortcuts__ & __getitem__ * client.py - remove "auth" & connection_manager.py - remove __shortcuts__ & __getitem__ * client.py - remove "callback" * client.py - remove "websocket" and __getitem__ & ws_client.py - remove __shortcuts__ * Fix rebase mess-up
This commit is contained in:
parent
138451d516
commit
4049023559
19 changed files with 134 additions and 185 deletions
|
@ -30,16 +30,6 @@ class WSClient(threading.Thread):
|
|||
self.client = client
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
def __shortcuts__(self, key):
|
||||
LOG.debug("__shortcuts__(%r)", key)
|
||||
|
||||
if key == "send":
|
||||
return self.send
|
||||
elif key == "stop":
|
||||
return self.stop_client()
|
||||
|
||||
return
|
||||
|
||||
def send(self, message, data=""):
|
||||
|
||||
if self.wsc is None:
|
||||
|
@ -50,9 +40,9 @@ class WSClient(threading.Thread):
|
|||
def run(self):
|
||||
|
||||
monitor = xbmc.Monitor()
|
||||
token = self.client['config/auth.token']
|
||||
device_id = self.client['config/app.device_id']
|
||||
server = self.client['config/auth.server']
|
||||
token = self.client.config.data['auth.token']
|
||||
device_id = self.client.config.data['app.device_id']
|
||||
server = self.client.config.data['auth.server']
|
||||
server = server.replace('https', "wss") if server.startswith('https') else server.replace('http', "ws")
|
||||
wsc_url = "%s/embywebsocket?api_key=%s&device_id=%s" % (server, token, device_id)
|
||||
|
||||
|
@ -88,10 +78,10 @@ class WSClient(threading.Thread):
|
|||
|
||||
return
|
||||
|
||||
if not self.client['config/app.default']:
|
||||
data['ServerId'] = self.client['auth/server-id']
|
||||
if not self.client.config.data['app.default']:
|
||||
data['ServerId'] = self.client.auth.server_id
|
||||
|
||||
self.client['callback_ws'](message['MessageType'], data)
|
||||
self.client.callback(message['MessageType'], data)
|
||||
|
||||
def stop_client(self):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue