mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-12-05 22:53:17 +00:00
Support up next
This commit is contained in:
parent
5808c449c4
commit
c3fbdf082c
5 changed files with 110 additions and 18 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#################################################################################################
|
||||
|
||||
import binascii
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
|
@ -127,13 +128,20 @@ def find(dict, item):
|
|||
if re.match(key, item, re.I):
|
||||
return dict[key]
|
||||
|
||||
def event(method, data=None):
|
||||
def event(method, data=None, sender=None, hexlify=False):
|
||||
|
||||
''' Data is a dictionary.
|
||||
'''
|
||||
data = data or {}
|
||||
xbmc.executebuiltin('NotifyAll(plugin.video.emby, %s, "[%s]")' % (method, json.dumps(data).replace('"', '\\"')))
|
||||
LOG.debug("---[ event: %s ] %s", method, data)
|
||||
sender = sender or "plugin.video.emby"
|
||||
|
||||
if hexlify:
|
||||
data = '\\"[\\"{0}\\"]\\"'.format(binascii.hexlify(json.dumps(data)))
|
||||
else:
|
||||
data = '"[%s]"' % json.dumps(data).replace('"', '\\"')
|
||||
|
||||
xbmc.executebuiltin('NotifyAll(%s, %s, %s)' % (sender, method, data))
|
||||
LOG.debug("---[ event: %s/%s ] %s", sender, method, data)
|
||||
|
||||
def dialog(dialog_type, *args, **kwargs):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue