Add type hints to media_player (part 2) (#64006)
parent
5cd73170de
commit
ed5e1af10a
|
@ -913,8 +913,11 @@ class KodiEntity(MediaPlayerEntity):
|
|||
return response
|
||||
|
||||
async def async_get_browse_image(
|
||||
self, media_content_type, media_content_id, media_image_id=None
|
||||
):
|
||||
self,
|
||||
media_content_type: str,
|
||||
media_content_id: str,
|
||||
media_image_id: str | None = None,
|
||||
) -> tuple[bytes | None, str | None]:
|
||||
"""Get media image from kodi server."""
|
||||
try:
|
||||
image_url, _, _ = await get_media_info(
|
||||
|
|
|
@ -457,8 +457,11 @@ class PhilipsTVMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
|
|||
raise BrowseError(f"Media not found: {media_content_type} / {media_content_id}")
|
||||
|
||||
async def async_get_browse_image(
|
||||
self, media_content_type, media_content_id, media_image_id=None
|
||||
):
|
||||
self,
|
||||
media_content_type: str,
|
||||
media_content_id: str,
|
||||
media_image_id: str | None = None,
|
||||
) -> tuple[bytes | None, str | None]:
|
||||
"""Serve album art. Returns (content, content_type)."""
|
||||
try:
|
||||
if media_content_type == MEDIA_TYPE_APP and media_content_id:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
"""Support to interface with the Plex API."""
|
||||
from __future__ import annotations
|
||||
|
||||
from functools import wraps
|
||||
import json
|
||||
import logging
|
||||
|
@ -571,8 +573,11 @@ class PlexMediaPlayer(MediaPlayerEntity):
|
|||
)
|
||||
|
||||
async def async_get_browse_image(
|
||||
self, media_content_type, media_content_id, media_image_id=None
|
||||
):
|
||||
self,
|
||||
media_content_type: str,
|
||||
media_content_id: str,
|
||||
media_image_id: str | None = None,
|
||||
) -> tuple[bytes | None, str | None]:
|
||||
"""Get media image from Plex server."""
|
||||
image_url = self.plex_server.thumbnail_cache.get(media_content_id)
|
||||
if image_url:
|
||||
|
|
|
@ -606,10 +606,10 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
|||
|
||||
async def async_get_browse_image(
|
||||
self,
|
||||
media_content_type: str | None,
|
||||
media_content_id: str | None,
|
||||
media_content_type: str,
|
||||
media_content_id: str,
|
||||
media_image_id: str | None = None,
|
||||
) -> tuple[None | str, None | str]:
|
||||
) -> tuple[bytes | None, str | None]:
|
||||
"""Fetch media browser image to serve via proxy."""
|
||||
if (
|
||||
media_content_type in [MEDIA_TYPE_ALBUM, MEDIA_TYPE_ARTIST]
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
"""Support for interfacing to the Logitech SqueezeBox API."""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
|
@ -562,8 +564,11 @@ class SqueezeBoxEntity(MediaPlayerEntity):
|
|||
return await build_item_response(self, self._player, payload)
|
||||
|
||||
async def async_get_browse_image(
|
||||
self, media_content_type, media_content_id, media_image_id=None
|
||||
):
|
||||
self,
|
||||
media_content_type: str,
|
||||
media_content_id: str,
|
||||
media_image_id: str | None = None,
|
||||
) -> tuple[bytes | None, str | None]:
|
||||
"""Get album art from Squeezebox server."""
|
||||
if media_image_id:
|
||||
image_url = self._player.generate_image_url_from_track_id(media_image_id)
|
||||
|
|
Loading…
Reference in New Issue