From 1b4a99bd7817d3bb31c7721a7a701c10d2387dcd Mon Sep 17 00:00:00 2001 From: faush01 Date: Wed, 18 Mar 2015 16:05:21 +1100 Subject: [PATCH] replace / with & in studio strings --- resources/lib/KodiMonitor.py | 2 +- resources/lib/WriteKodiDB.py | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/resources/lib/KodiMonitor.py b/resources/lib/KodiMonitor.py index a0fcdc4b..ab55c281 100644 --- a/resources/lib/KodiMonitor.py +++ b/resources/lib/KodiMonitor.py @@ -29,9 +29,9 @@ class Kodi_Monitor(xbmc.Monitor): # and when the playcount is updated byt he sync it just sends the same data back to the server # if you add this back in you will never be able to trigger a play status update while the sync is running - xbmc.log("Kodi_Monitor -> onNotification -> VideoLibrary.OnUpdate : " + str(data)) jsondata = json.loads(data) if jsondata != None: + xbmc.log("Kodi_Monitor -> onNotification -> VideoLibrary.OnUpdate : " + str(data)) playcount = None playcount = jsondata.get("playcount") item = jsondata.get("item").get("id") diff --git a/resources/lib/WriteKodiDB.py b/resources/lib/WriteKodiDB.py index f5dd229c..5138cd47 100644 --- a/resources/lib/WriteKodiDB.py +++ b/resources/lib/WriteKodiDB.py @@ -126,7 +126,12 @@ class WriteKodiDB(): changes = self.updatePropertyArray(KodiItem,"writer",people.get("Writer"),"movie") changes = self.updatePropertyArray(KodiItem,"director",people.get("Director"),"movie") changes = self.updatePropertyArray(KodiItem,"genre",MBitem.get("Genres"),"movie") - changes = self.updatePropertyArray(KodiItem,"studio",studios,"movie") + + if(studios != None): + for x in range(0, len(studios)): + studios[x] = studios[x].replace("/", "&") + changes = self.updatePropertyArray(KodiItem,"studio",studios,"movie") + # FIXME --> ProductionLocations not returned by MB3 server !? self.updatePropertyArray(KodiItem,"country",MBitem.get("ProductionLocations"),"movie") @@ -196,7 +201,11 @@ class WriteKodiDB(): changes = self.updatePropertyArray(KodiItem,"genre",MBitem.get("Genres"),"tvshow") - changes = self.updatePropertyArray(KodiItem,"studio",studios,"tvshow") + + if(studios != None): + for x in range(0, len(studios)): + studios[x] = studios[x].replace("/", "&") + changes = self.updatePropertyArray(KodiItem,"studio",studios,"tvshow") # FIXME --> ProductionLocations not returned by MB3 server !? changes = self.updatePropertyArray(KodiItem,"country",MBitem.get("ProductionLocations"),"tvshow") @@ -349,10 +358,9 @@ class WriteKodiDB(): elif fileType == "movie": id = KodiItem['movieid'] jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": { "movieid": %i, "%s": %s}, "id": 1 }' - - + pendingChanges = False - if propertyCollection != None: + if propertyCollection != None: currentvalues = set(KodiItem[propertyName]) genrestring = "" for item in propertyCollection: