Fix string formatting on folder names

This commit is contained in:
vitiko98 2020-12-12 17:40:52 -04:00
parent 9cec3fccfb
commit b7224d5515
4 changed files with 13 additions and 5 deletions

View File

@ -1,2 +1,2 @@
from .cli import main
from .qopy import Client from .qopy import Client
from .cli import main

View File

@ -92,7 +92,7 @@ def qobuz_dl_args(
"-n", "-n",
"--number", "--number",
metavar="int", metavar="int",
default=default_limit, default=1,
help="number of results to download (default: 1)", help="number of results to download (default: 1)",
) )
add_common_arg(lucky) add_common_arg(lucky)

View File

@ -143,7 +143,11 @@ def download_id_by_type(client, item_id, path, quality, album=False, embed_art=F
if album: if album:
meta = client.get_album_meta(item_id) meta = client.get_album_meta(item_id)
try: try:
album_title = "{} ({})".format(meta["title"], meta["version"]) album_title = (
("{} ({})".format(meta["title"], meta["version"]))
if meta["version"]
else meta["title"]
)
except KeyError: except KeyError:
album_title = meta["title"] album_title = meta["title"]
print("\nDownloading: {}\n".format(album_title)) print("\nDownloading: {}\n".format(album_title))
@ -188,7 +192,11 @@ def download_id_by_type(client, item_id, path, quality, album=False, embed_art=F
if "sample" not in parse and parse["sampling_rate"]: if "sample" not in parse and parse["sampling_rate"]:
meta = client.get_track_meta(item_id) meta = client.get_track_meta(item_id)
try: try:
track_title = "{} ({})".format(meta["title"], meta["version"]) track_title = (
("{} ({})".format(meta["title"], meta["version"]))
if meta["version"]
else meta["title"]
)
except KeyError: except KeyError:
track_title = meta["title"] track_title = meta["title"]
print("\nDownloading: {}\n".format(track_title)) print("\nDownloading: {}\n".format(track_title))

View File

@ -16,7 +16,7 @@ if os.name == "nt" or "win" in sys.platform:
setup( setup(
name=pkg_name, name=pkg_name,
version="0.5.3", version="0.5.4.1",
author="Vitiko", author="Vitiko",
author_email="vhnz98@gmail.com", author_email="vhnz98@gmail.com",
description="The complete Lossless and Hi-Res music downloader for Qobuz", description="The complete Lossless and Hi-Res music downloader for Qobuz",