Websocket media browsing for Plex (#35590)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
8 files changed
+323
-17
No files matched your search
@@ -31,7 +31,6 @@ from .const import (
|
||||
CONF_USE_EPISODE_ART,
|
||||
DEBOUNCE_TIMEOUT,
|
||||
DEFAULT_VERIFY_SSL,
|
||||
DOMAIN,
|
||||
PLAYER_SOURCE,
|
||||
PLEX_NEW_MP_SIGNAL,
|
||||
PLEX_UPDATE_MEDIA_PLAYER_SIGNAL,
|
||||
@@ -449,6 +448,10 @@ class PlexServer:
|
||||
"""Return playlist from server object."""
|
||||
return self._plex_server.playlist(title)
|
||||
|
||||
def playlists(self):
|
||||
"""Return available playlists from server object."""
|
||||
return self._plex_server.playlists()
|
||||
|
||||
def create_playqueue(self, media, **kwargs):
|
||||
"""Create playqueue on Plex server."""
|
||||
return plexapi.playqueue.PlayQueue.create(self._plex_server, media, **kwargs)
|
||||
@@ -461,7 +464,7 @@ class PlexServer:
|
||||
"""Lookup a piece of media."""
|
||||
media_type = media_type.lower()
|
||||
|
||||
if media_type == DOMAIN:
|
||||
if isinstance(kwargs.get("plex_key"), int):
|
||||
key = kwargs["plex_key"]
|
||||
try:
|
||||
return self.fetch_item(key)
|
||||
|
||||
Reference in new issue
Block a user