feat: download tracks with full ID3 metadata

- Add downloads.py: "Artist - Title.mp3" naming, no-overwrite dedupe,
  configurable download_dir, progress and per-item callbacks.
- Save maximum metadata via tags.py (ID3v2.3, mutagen): artists, album
  and album artist, track/disc, year/date, raw genre, label, duration,
  explicit flag, cover 600x600, plain and synced lyrics (MTS then
  LRCLIB), track URLs and Yandex/MTS ids.
- TUI/Qt: download current track and queue from the menu, "d" key in
  lists, folder picker in settings; CLI download gains -d/--dir and
  --no-tags.
- Add mutagen to requirements and document download/metadata in README.
- Fix MPRIS update_metadata crashing without dbus-next.
This commit is contained in:
jads
2026-10-25 20:06:59 +03:00
parent e71f5623a7
commit de9bf80d11
9 changed files with 754 additions and 37 deletions

View File

@@ -10,12 +10,15 @@ from mtsmusic import CONFIG_DIR
SETTINGS_PATH = CONFIG_DIR / "settings.json"
DEFAULT_DOWNLOAD_DIR = str(Path.home() / "Music" / "MTS Music")
DEFAULTS: dict[str, Any] = {
"volume": 80, # громкость 0..100
"seek_step": 5, # шаг перемотки стрелками, секунды
"autoplay": False, # запускать воспроизведение сразу
"start_queue": "wave", # wave | favorites | history
"wave_from_history": True, # продолжать волну с последних треков
"download_dir": DEFAULT_DOWNLOAD_DIR, # куда сохранять скачанные MP3
}
START_QUEUES = ("wave", "favorites", "history")
@@ -47,6 +50,11 @@ def _coerce(key: str, value: Any) -> Any:
if key == "start_queue":
text = str(value)
return text if text in START_QUEUES else DEFAULTS[key]
if key == "download_dir":
text = str(value).strip()
if not text:
return DEFAULTS[key]
return str(Path(text).expanduser())
return value