Sort_YM/sort_ym/classify.py
Andrew Pimenov 353be65e3a init: сортировка лайков Яндекс.Музыки по жанру и языку
CLI на yandex-music (device-flow auth, fetch/report/apply), жанр через
реальное дерево client.genres(), язык гибридом (track_supplement + алфавит).
2026-07-06 09:49:36 +03:00

27 lines
796 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from __future__ import annotations
BUCKET_LABELS: dict[str, str] = {
"pop": "Поп",
"rock": "Рок",
"metal": "Метал",
"rap": "Рэп",
"electronic": "Электроника",
"jazz-blues": "Джаз и блюз",
"classical": "Классика",
"folk-world": "Фолк и world",
"indie-alt": "Инди и альтернатива",
"soundtrack": "Саундтреки",
"other": "Разное",
}
LANG_LABELS: dict[str, str] = {
"RU": "RU",
"INT": "INT",
"UNKNOWN": "Не определено",
}
def playlist_name(bucket: str, lang: str) -> str:
bucket_label = BUCKET_LABELS.get(bucket, BUCKET_LABELS["other"])
lang_label = LANG_LABELS.get(lang, LANG_LABELS["UNKNOWN"])
return f"{bucket_label} — {lang_label}"