Skip to content

Commit

Permalink
Всегда записывать год релиза для .m4a
Browse files Browse the repository at this point in the history
  • Loading branch information
llistochek committed Nov 21, 2024
1 parent 4bfaef0 commit 7bdbee9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "yandex-music-downloader"
version = "3.2.0b3"
version = "3.2.0b4"
description = "Загрузчик музыки с сервиса Яндекс.Музыка"
requires-python = ">=3.9"
readme = "README.md"
Expand Down
5 changes: 3 additions & 2 deletions ymd/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,13 @@ def set_tags(
track_number = position.index
disc_number = position.volume
iso8601_release_date = None
release_year: Optional[str] = None
if album.release_date is not None:
iso8601_release_date = dt.datetime.fromisoformat(album.release_date).astimezone(
dt.timezone.utc
)
release_year = str(iso8601_release_date.year)
iso8601_release_date = iso8601_release_date.strftime("%Y-%m-%d %H:%M:%S")
release_year = None
if year := album.year:
release_year = str(year)
track_url = f"https://music.yandex.ru/album/{album.id}/track/{track.id}"
Expand Down Expand Up @@ -157,7 +158,7 @@ def set_tags(

if iso8601_release_date is not None:
tag["rldt"] = iso8601_release_date
elif release_year is not None:
if release_year is not None:
tag["\xa9day"] = release_year
if track_number:
tag["trkn"] = [(track_number, 0)]
Expand Down

0 comments on commit 7bdbee9

Please sign in to comment.