from typing import Awaitable, Dict, Iterable, List from server.constants import SPOTIFY_PLAYLIST_IMAGE_URL_MASK async def get_spotify_playlists_images_urls(playlists_ids: Iterable[str]) -> List[Dict]: """Returns list of {"id": playlist_id, "image_url": playlist_image_url}.""" return [ {"id": p_id, "image_url": SPOTIFY_PLAYLIST_IMAGE_URL_MASK.format(playlist_id=p_id)} for p_id in playlists_ids ] def get_spotify_playlists_images(playlist_ids: List[str], *args, **kwargs) -> Awaitable: return get_spotify_playlists_images_urls(playlist_ids)