"""Logic for Apple Artists.""" from artist.constants import apple as const from artist.models import apple from artist.models import vendor def search(query, account_id): """Search for artists with a similar name. Args: query(str): Artist name. """ if not account_id: # Default to US storefront. storefront = const.DEFAULT_STOREFRONT else: storefront = vendor.get_country_code_by_vendor_id(account_id) \ or const.DEFAULT_STOREFRONT storefront = storefront.lower() return apple.search(query, storefront)