From 1d944cc9fb6ca63780a07f3954a3fe9da941e43c Mon Sep 17 00:00:00 2001 From: Lev Plyusnin Date: Sun, 15 Jun 2025 11:24:03 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BF=D1=83=D1=82=D0=B8=20(#track-artist)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- pyproject.toml | 2 +- ymd/cli.py | 2 +- ymd/core.py | 19 +++++++++---------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c167fdc..8f00d66 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ ID: --unsafe-path Не очищать путь от недопустимых символов --dir <Папка> Папка для загрузки музыки (по умолчанию: .) --path-pattern <Паттерн> - Поддерживает следующие заполнители: #number, #artist, #album-artist, #title, #album, #year, #artist-id, #album-id, #track-id, #number-padded (по умолчанию: #album-artist/#album/#number - #title) + Поддерживает следующие заполнители: #number, #track-artist, #album-artist, #title, #album, #year, #artist-id, #album-id, #track-id, #number-padded (по умолчанию: #album-artist/#album/#number - #title) Авторизация: --token <Токен> Токен для авторизации. См. README для способов получения diff --git a/pyproject.toml b/pyproject.toml index 8c769e7..f0ba103 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "yandex-music-downloader" -version = "3.5.0" +version = "3.5.1" description = "Загрузчик музыки с сервиса Яндекс.Музыка" requires-python = ">=3.9" readme = "README.md" diff --git a/ymd/cli.py b/ymd/cli.py index 99adf4b..9d69327 100644 --- a/ymd/cli.py +++ b/ymd/cli.py @@ -205,7 +205,7 @@ def main(): type=Path, help=show_default( "Поддерживает следующие заполнители:" - " #number, #artist, #album-artist, #title," + " #number, #track-artist, #album-artist, #title," " #album, #year, #artist-id, #album-id, #track-id, #number-padded" ), ) diff --git a/ymd/core.py b/ymd/core.py index 41bb5e2..b9b9bb3 100644 --- a/ymd/core.py +++ b/ymd/core.py @@ -135,27 +135,26 @@ def prepare_base_path( ) -> Path: path_str = str(path_pattern) album = None - artist = None + album_artist = None + track_artist = None track_position = None if albums := track.albums: album = albums[0] track_position = album.track_position - if artists := track.artists: - artist = artists[0] - elif artists := album.artists: - artists = artists[0] - if artist is None and (artists := track.artists): - artist = artists[0] + if artists := album.artists: + album_artist = artists[0] + if artists := track.artists: + track_artist = artists[0] repl_dict: dict[str, Union[str, int, None]] = { "#number-padded": str(track_position.index).zfill(len(str(album.track_count))) if track_position and album else None, - "#album-artist": artist.name if artist else None, - "#artist-id": artist.id if artist else None, + "#album-artist": album_artist.name if album_artist else None, + "#track-artist": track_artist.name if track_artist else None, + "#artist-id": track_artist.id if track_artist else None, "#album-id": album.id if album else None, "#track-id": track.id, "#number": track_position.index if track_position else None, - "#artist": artist.name if artist else None, "#title": full_title(track), "#album": full_title(album) if album else None, "#year": album.year if album else None,