import pycountry from slugify import slugify from server.dna.constants import N_A HEADER_GROUP = "header" STREAMING_SERVICES_GROUP = "streaming_services" SOCIAL_MEDIA_GROUP = "social_media" EXTERNAL_LINKS_GROUPS = { # header "website": HEADER_GROUP, "tiktok": HEADER_GROUP, "youtube": HEADER_GROUP, "spotify": HEADER_GROUP, "soundcloud": HEADER_GROUP, "itunes": HEADER_GROUP, # streaming services "amazon": STREAMING_SERVICES_GROUP, "deezer": STREAMING_SERVICES_GROUP, "pandora": STREAMING_SERVICES_GROUP, "genius": STREAMING_SERVICES_GROUP, "shazam": STREAMING_SERVICES_GROUP, "line_music": STREAMING_SERVICES_GROUP, "melon": STREAMING_SERVICES_GROUP, # social media "instagram": SOCIAL_MEDIA_GROUP, "facebook": SOCIAL_MEDIA_GROUP, "youtubeforartist": SOCIAL_MEDIA_GROUP, "twitter": SOCIAL_MEDIA_GROUP, "wikipedia": SOCIAL_MEDIA_GROUP, "musicbrainz": SOCIAL_MEDIA_GROUP, "discogs": SOCIAL_MEDIA_GROUP, "songkick": SOCIAL_MEDIA_GROUP, "bandsintown": SOCIAL_MEDIA_GROUP, "twitch": SOCIAL_MEDIA_GROUP, "tunefind": SOCIAL_MEDIA_GROUP, "tvmaze": SOCIAL_MEDIA_GROUP, } HEADER_ORDER = ("website", "tiktok", "youtube", "spotify", "soundcloud", "itunes") temp_countries_list_name = [country.name for country in pycountry.countries] COUNTRIES_LIST_NAME = temp_countries_list_name + [N_A] temp_countries_slug_name = [slugify(country.alpha_2) for country in pycountry.countries] COUNTRIES_LIST_SLUG_NAME = temp_countries_slug_name + [slugify(N_A)] temp_countries_mapper = [{"code": slugify(country.alpha_2), "name": country.name} for country in pycountry.countries] temp_countries_mapper.append({"code": slugify(N_A), "name": N_A}) COUNTRIES_MAPPER = sorted(temp_countries_mapper, key=lambda d: d["name"])