From a4e1a622e0c45a3088085e2eaa05809aa13a1467 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Fri, 19 Feb 2016 12:31:55 +0100 Subject: [PATCH] Fix KodiItemTypes --- resources/lib/PlexFunctions.py | 16 ++++++++-------- resources/lib/playbackutils.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/lib/PlexFunctions.py b/resources/lib/PlexFunctions.py index c95457b8..4ae4e25d 100644 --- a/resources/lib/PlexFunctions.py +++ b/resources/lib/PlexFunctions.py @@ -42,17 +42,17 @@ def GetItemClassFromType(itemType): def GetKodiTypeFromPlex(plexItemType): - classes = { - 'movie': 'video', - 'episode': 'video', - } - return classes[plexItemType.lower()] - - -def GetKodiItemTypeFromPlex(plexItemType): + """ + As used in playlist.item here: http://kodi.wiki/view/JSON-RPC_API + """ classes = { 'movie': 'movie', 'episode': 'episode', + 'track': 'song', + 'artist': 'artist', + 'album': 'album', + 'XXXXXX': 'musicvideo', + 'XXXXXXX': 'genre' } return classes[plexItemType.lower()] diff --git a/resources/lib/playbackutils.py b/resources/lib/playbackutils.py index 5d8de082..9bf398af 100644 --- a/resources/lib/playbackutils.py +++ b/resources/lib/playbackutils.py @@ -133,7 +133,7 @@ class PlaybackUtils(): self.logMsg("Adding main item to playlist.", 1) self.pl.addtoPlaylist( dbid, - PF.GetKodiItemTypeFromPlex(API.getType())) + PF.GetKodiTypeFromPlex(API.getType())) # Ensure that additional parts are played after the main item self.currentPosition += 1