Fix problem with booleans from configparser

This commit is contained in:
vitiko98 2020-12-18 19:10:37 -04:00
parent f370b5c0b0
commit df578d1d02
3 changed files with 16 additions and 9 deletions

View File

@ -81,12 +81,12 @@ def main():
default_folder = config["DEFAULT"]["default_folder"] default_folder = config["DEFAULT"]["default_folder"]
default_limit = config["DEFAULT"]["default_limit"] default_limit = config["DEFAULT"]["default_limit"]
default_quality = config["DEFAULT"]["default_quality"] default_quality = config["DEFAULT"]["default_quality"]
no_m3u = config["DEFAULT"]["no_m3u"] no_m3u = config.getboolean("DEFAULT", "no_m3u")
albums_only = config["DEFAULT"]["albums_only"] albums_only = config.getboolean("DEFAULT", "albums_only")
no_fallback = config["DEFAULT"]["no_fallback"] no_fallback = config.getboolean("DEFAULT", "no_fallback")
og_cover = config["DEFAULT"]["og_cover"] og_cover = config.getboolean("DEFAULT", "og_cover")
embed_art = config["DEFAULT"]["embed_art"] embed_art = config.getboolean("DEFAULT", "embed_art")
no_cover = config["DEFAULT"]["no_cover"] no_cover = config.getboolean("DEFAULT", "no_cover")
app_id = config["DEFAULT"]["app_id"] app_id = config["DEFAULT"]["app_id"]
secrets = [ secrets = [
secret for secret in config["DEFAULT"]["secrets"].split(",") if secret secret for secret in config["DEFAULT"]["secrets"].split(",") if secret

View File

@ -221,8 +221,13 @@ def download_id_by_type(
sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT)) sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT))
dirn = os.path.join(path, sanitized_title) dirn = os.path.join(path, sanitized_title)
os.makedirs(dirn, exist_ok=True) os.makedirs(dirn, exist_ok=True)
if not no_cover:
if no_cover:
logger.info(f"{OFF}Skipping cover")
else:
get_extra(meta["image"]["large"], dirn, og_quality=cover_og_quality) get_extra(meta["image"]["large"], dirn, og_quality=cover_og_quality)
if "goodies" in meta: if "goodies" in meta:
try: try:
get_extra(meta["goodies"][0]["url"], dirn, "booklet.pdf") get_extra(meta["goodies"][0]["url"], dirn, "booklet.pdf")
@ -278,7 +283,9 @@ def download_id_by_type(
sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT)) sanitized_title = sanitize_filename("{} - {} [{}] [{}]".format(*dirT))
dirn = os.path.join(path, sanitized_title) dirn = os.path.join(path, sanitized_title)
os.makedirs(dirn, exist_ok=True) os.makedirs(dirn, exist_ok=True)
if not no_cover: if no_cover:
logger.info(f"{OFF}Skipping cover")
else:
get_extra( get_extra(
meta["album"]["image"]["large"], dirn, og_quality=cover_og_quality meta["album"]["image"]["large"], dirn, og_quality=cover_og_quality
) )

View File

@ -13,7 +13,7 @@ requirements = read_file("requirements.txt").strip().split()
setup( setup(
name=pkg_name, name=pkg_name,
version="0.8.0", version="0.8.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",