mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Handle Plex searches in URL media_content_id format (#72462)
This commit is contained in:
parent
b8e9b8f540
commit
fbeaf200e4
@ -123,7 +123,9 @@ def process_plex_payload(
|
|||||||
plex_url = URL(content_id)
|
plex_url = URL(content_id)
|
||||||
if plex_url.name:
|
if plex_url.name:
|
||||||
if len(plex_url.parts) == 2:
|
if len(plex_url.parts) == 2:
|
||||||
# The path contains a single item, will always be a ratingKey
|
if plex_url.name == "search":
|
||||||
|
content = {}
|
||||||
|
else:
|
||||||
content = int(plex_url.name)
|
content = int(plex_url.name)
|
||||||
else:
|
else:
|
||||||
# For "special" items like radio stations
|
# For "special" items like radio stations
|
||||||
@ -132,6 +134,9 @@ def process_plex_payload(
|
|||||||
plex_server = get_plex_server(hass, plex_server_id=server_id)
|
plex_server = get_plex_server(hass, plex_server_id=server_id)
|
||||||
else:
|
else:
|
||||||
# Handle legacy payloads without server_id in URL host position
|
# Handle legacy payloads without server_id in URL host position
|
||||||
|
if plex_url.host == "search":
|
||||||
|
content = {}
|
||||||
|
else:
|
||||||
content = int(plex_url.host) # type: ignore[arg-type]
|
content = int(plex_url.host) # type: ignore[arg-type]
|
||||||
extra_params = dict(plex_url.query)
|
extra_params = dict(plex_url.query)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user