from typing import Dict, Iterable, Set from smelog.factory import BoundLogger from apollo_playlists_messages.clients.gate_api import GateApiClient from apollo_playlists_messages.utils.favorites import parse_favorites_accounts def get_favorites_accounts( ids: Iterable[str], entity_type: str, user_favorite_type_to_id_to_accounts: Dict[str, Dict[str, Set[int]]], user_dsp_to_accounts: Dict[str, Set[int]], user_code_to_accounts: Dict[str, Set[int]], user_account_to_devices: Dict[int, Iterable[dict]], gate_api: GateApiClient, logger: BoundLogger, ): favorites_accounts = gate_api.get_favorites_with_accounts(ids=list(ids), entity_type=entity_type) parse_favorites_accounts( entities=favorites_accounts, logger=logger, entity_types=(entity_type,), type_to_id_to_accounts=user_favorite_type_to_id_to_accounts, type_to_dsp_to_accounts={entity_type: user_dsp_to_accounts}, type_to_country_codes_to_accounts={entity_type: user_code_to_accounts}, account_id_to_devices=user_account_to_devices, )