Plex Companion: Fix KeyError for Plex Web
This commit is contained in:
parent
b93925d678
commit
990e21ac99
1 changed files with 12 additions and 3 deletions
|
@ -9,7 +9,8 @@ from xbmc import sleep
|
||||||
from utils import settings, ThreadMethodsAdditionalSuspend, ThreadMethods
|
from utils import settings, ThreadMethodsAdditionalSuspend, ThreadMethods
|
||||||
from plexbmchelper import listener, plexgdm, subscribers, functions, \
|
from plexbmchelper import listener, plexgdm, subscribers, functions, \
|
||||||
httppersist, plexsettings
|
httppersist, plexsettings
|
||||||
from PlexFunctions import ParseContainerKey
|
from PlexFunctions import ParseContainerKey, GetPlexMetadata
|
||||||
|
from PlexAPI import API
|
||||||
import player
|
import player
|
||||||
from entrypoint import Plex_Node
|
from entrypoint import Plex_Node
|
||||||
from variables import KODI_PLAYLIST_TYPE_FROM_PLEX_TYPE
|
from variables import KODI_PLAYLIST_TYPE_FROM_PLEX_TYPE
|
||||||
|
@ -95,8 +96,16 @@ class PlexCompanion(Thread):
|
||||||
import traceback
|
import traceback
|
||||||
log.error("Traceback:\n%s" % traceback.format_exc())
|
log.error("Traceback:\n%s" % traceback.format_exc())
|
||||||
return
|
return
|
||||||
playqueue = self.mgr.playqueue.get_playqueue_from_type(
|
try:
|
||||||
KODI_PLAYLIST_TYPE_FROM_PLEX_TYPE[data['type']])
|
playqueue = self.mgr.playqueue.get_playqueue_from_type(
|
||||||
|
KODI_PLAYLIST_TYPE_FROM_PLEX_TYPE[data['type']])
|
||||||
|
except KeyError:
|
||||||
|
# E.g. Plex web does not supply the media type
|
||||||
|
# Still need to figure out the type (video vs. music vs. pix)
|
||||||
|
xml = GetPlexMetadata(data['key'])
|
||||||
|
api = API(xml[0])
|
||||||
|
playqueue = self.mgr.playqueue.get_playqueue_from_type(
|
||||||
|
KODI_PLAYLIST_TYPE_FROM_PLEX_TYPE[api.getType()])
|
||||||
self.mgr.playqueue.update_playqueue_from_PMS(
|
self.mgr.playqueue.update_playqueue_from_PMS(
|
||||||
playqueue,
|
playqueue,
|
||||||
ID,
|
ID,
|
||||||
|
|
Loading…
Reference in a new issue