Remove awful function

This commit is contained in:
vitiko98 2020-12-15 13:58:25 -04:00
parent 835f84e2c5
commit f68fadea11
3 changed files with 7 additions and 14 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@ Qobuz Downloads
__pycache__/
*.py[cod]
*$py.class
.bumpversion.cfg
/*.py
!/setup.py

View File

@ -23,14 +23,7 @@ def tqdm_download(url, fname, track_name):
bar.update(size)
def mkDir(dirn):
try:
os.makedirs(dirn, exist_ok=True)
except FileExistsError:
pass
def getDesc(u, mt, multiple=None):
def get_description(u, mt, multiple=None):
return "{} [{}/{}]".format(
("[Disc {}] {}".format(multiple, mt["title"])) if multiple else mt["title"],
u["bit_depth"],
@ -126,7 +119,7 @@ def download_and_tag(
if multiple:
root_dir = os.path.join(root_dir, "Disc " + str(multiple))
mkDir(root_dir)
os.makedirs(root_dir, exist_ok=True)
filename = os.path.join(root_dir, ".{:02}".format(tmp_count) + extension)
@ -139,7 +132,7 @@ def download_and_tag(
print(track_metadata["title"] + " was already downloaded. Skipping...")
return
desc = getDesc(track_url_dict, track_metadata, multiple)
desc = get_description(track_url_dict, track_metadata, multiple)
tqdm_download(url, filename, desc)
tag_function = metadata.tag_mp3 if is_mp3 else metadata.tag_flac
try:
@ -193,7 +186,7 @@ def download_id_by_type(
)
sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT))
dirn = os.path.join(path, sanitized_title)
mkDir(dirn)
os.makedirs(dirn, exist_ok=True)
get_extra(meta["image"]["large"], dirn)
if "goodies" in meta:
try:
@ -235,7 +228,7 @@ def download_id_by_type(
)
sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT))
dirn = os.path.join(path, sanitized_title)
mkDir(dirn)
os.makedirs(dirn, exist_ok=True)
get_extra(meta["album"]["image"]["large"], dirn)
is_mp3 = True if int(quality) == 5 else False
download_and_tag(dirn, count, parse, meta, meta, True, is_mp3, embed_art)

View File

@ -13,7 +13,7 @@ requirements = read_file("requirements.txt").strip().split()
setup(
name=pkg_name,
version="0.5.5.2",
version="0.5.5.3",
author="Vitiko",
author_email="vhnz98@gmail.com",
description="The complete Lossless and Hi-Res music downloader for Qobuz",