mirror of
https://github.com/Wojtek242/qobuz-dl.git
synced 2024-11-22 11:05:25 +01:00
Close #49
This commit is contained in:
parent
b8e68e2bf3
commit
7ef09f3c4a
@ -141,13 +141,17 @@ def download_and_tag(
|
|||||||
|
|
||||||
# Determine the filename
|
# Determine the filename
|
||||||
artist = track_metadata.get("performer", {}).get("name")
|
artist = track_metadata.get("performer", {}).get("name")
|
||||||
|
album_artist = track_metadata.get("album", {}).get("artist", {}).get("name")
|
||||||
|
new_track_title = track_metadata.get("title")
|
||||||
version = track_metadata.get("version")
|
version = track_metadata.get("version")
|
||||||
|
|
||||||
|
if artist or album_artist:
|
||||||
new_track_title = (
|
new_track_title = (
|
||||||
f'{artist if artist else track_metadata["album"]["artist"]["name"]}'
|
f"{artist if artist else album_artist}" f' - {track_metadata["title"]}'
|
||||||
f' - {track_metadata["title"]}'
|
|
||||||
)
|
)
|
||||||
if version:
|
if version:
|
||||||
new_track_title = f"{new_track_title} ({version})"
|
new_track_title = f"{new_track_title} ({version})"
|
||||||
|
|
||||||
track_file = f'{track_metadata["track_number"]:02}. {new_track_title}{extension}'
|
track_file = f'{track_metadata["track_number"]:02}. {new_track_title}{extension}'
|
||||||
final_file = os.path.join(root_dir, sanitize_filename(track_file))
|
final_file = os.path.join(root_dir, sanitize_filename(track_file))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user