diff --git a/addon.xml b/addon.xml index d7892e8..fc53112 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/action_menu.py b/resources/lib/action_menu.py index f9863fe..5a052f9 100644 --- a/resources/lib/action_menu.py +++ b/resources/lib/action_menu.py @@ -4,7 +4,6 @@ import time import threading import xbmc -import xbmcaddon import xbmcgui from .simple_logging import SimpleLogging diff --git a/resources/lib/dir_functions.py b/resources/lib/dir_functions.py index bf4a1a2..2791579 100644 --- a/resources/lib/dir_functions.py +++ b/resources/lib/dir_functions.py @@ -1,3 +1,5 @@ +# Gnu General Public License - see LICENSE.TXT + import xbmcaddon import xbmcplugin import xbmcgui @@ -158,7 +160,9 @@ def getContent(url, params): xbmcplugin.endOfDirectory(pluginhandle, cacheToDisc=False) # send display items event + display_items_notification = {"view_type": view_type} + log.debug("Sending display_items with data {0}", display_items_notification) send_event_notification("display_items", display_items_notification) if (progress != None): diff --git a/resources/lib/functions.py b/resources/lib/functions.py index f7b1569..72bcf80 100644 --- a/resources/lib/functions.py +++ b/resources/lib/functions.py @@ -8,11 +8,6 @@ import cProfile import pstats import json import StringIO -import encodings -import binascii -import re -import hashlib -import cPickle import xbmcplugin import xbmcgui diff --git a/resources/lib/play_utils.py b/resources/lib/play_utils.py index 26d7884..918333e 100644 --- a/resources/lib/play_utils.py +++ b/resources/lib/play_utils.py @@ -1,16 +1,13 @@ # Gnu General Public License - see LICENSE.TXT -import binascii - import xbmc import xbmcgui import xbmcaddon -import xbmcvfs from datetime import timedelta -from datetime import datetime import json import os +import base64 from .simple_logging import SimpleLogging from .downloadutils import DownloadUtils @@ -1215,9 +1212,9 @@ class PlaybackService(xbmc.Monitor): return data_json = json.loads(data) - hex_data = data_json[0] - log.debug("PlaybackService:onNotification:{0}", hex_data) - decoded_data = binascii.unhexlify(hex_data) + message_data = data_json[0] + log.debug("PlaybackService:onNotification:{0}", message_data) + decoded_data = base64.b64decode(message_data) play_info = json.loads(decoded_data) if signal == "embycon_play_action": diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 7b19f6a..30ddea9 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -1,14 +1,12 @@ # Gnu General Public License - see LICENSE.TXT import xbmcaddon -import xbmcgui -import xbmcplugin import xbmc import string import random import urllib import json -import binascii +import base64 import time from datetime import datetime import _strptime @@ -311,10 +309,11 @@ def single_urlencode(text): def send_event_notification(method, data): - next_data = json.dumps(data) + message_data = json.dumps(data) source_id = "embycon" - data = '\\"[\\"{0}\\"]\\"'.format(binascii.hexlify(next_data)) - command = 'XBMC.NotifyAll({0}.SIGNAL,{1},{2})'.format(source_id, method, data) + base64_data = base64.b64encode(message_data) + escaped_data = '\\"[\\"{0}\\"]\\"'.format(base64_data) + command = 'XBMC.NotifyAll({0}.SIGNAL,{1},{2})'.format(source_id, method, escaped_data) log.debug("Sending notification event data: {0}", command) xbmc.executebuiltin(command) diff --git a/service.py b/service.py index d8b53ab..601412b 100644 --- a/service.py +++ b/service.py @@ -2,14 +2,10 @@ # Gnu General Public License - see LICENSE.TXT import time -import json import traceback -import binascii -from threading import Timer import xbmc import xbmcaddon -import xbmcgui from resources.lib.downloadutils import DownloadUtils, save_user_details from resources.lib.simple_logging import SimpleLogging