mirror of
https://github.com/Wojtek242/qobuz-dl.git
synced 2024-12-22 15:24:40 +01:00
Replace YEAR by DATE (close #42)
This commit is contained in:
parent
df578d1d02
commit
4861c6ab85
@ -61,7 +61,7 @@ def add_common_arg(custom_parser, default_folder, default_quality):
|
||||
"--directory",
|
||||
metavar="PATH",
|
||||
default=default_folder,
|
||||
help=f'directory for downloads (default: "{default_folder}")'
|
||||
help=f'directory for downloads (default: "{default_folder}")',
|
||||
)
|
||||
custom_parser.add_argument(
|
||||
"-q",
|
||||
@ -92,7 +92,9 @@ def add_common_arg(custom_parser, default_folder, default_quality):
|
||||
"-e", "--embed-art", action="store_true", help="embed cover art into files"
|
||||
)
|
||||
custom_parser.add_argument(
|
||||
"--og-cover", action="store_true", help="download cover art in its original quality (bigger file)"
|
||||
"--og-cover",
|
||||
action="store_true",
|
||||
help="download cover art in its original quality (bigger file)",
|
||||
)
|
||||
custom_parser.add_argument(
|
||||
"--no-cover", action="store_true", help="don't download cover art"
|
||||
|
@ -59,7 +59,7 @@ class QobuzDL:
|
||||
no_m3u_for_playlists=False,
|
||||
quality_fallback=True,
|
||||
cover_og_quality=False,
|
||||
no_cover=False
|
||||
no_cover=False,
|
||||
):
|
||||
self.directory = self.create_dir(directory)
|
||||
self.quality = quality
|
||||
@ -112,7 +112,7 @@ class QobuzDL:
|
||||
self.no_cover,
|
||||
)
|
||||
except requests.exceptions.RequestException as e:
|
||||
logger.error(f"Error getting release: {e}")
|
||||
logger.error(f"{RED}Error getting release: {e}", exc_info=True)
|
||||
|
||||
def handle_url(self, url):
|
||||
possibles = {
|
||||
|
@ -162,7 +162,7 @@ def download_and_tag(
|
||||
embed_art,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"{RED}Error tagging the file: {e}")
|
||||
logger.error(f"{RED}Error tagging the file: {e}", exc_info=True)
|
||||
|
||||
|
||||
def download_id_by_type(
|
||||
@ -227,7 +227,6 @@ def download_id_by_type(
|
||||
else:
|
||||
get_extra(meta["image"]["large"], dirn, og_quality=cover_og_quality)
|
||||
|
||||
|
||||
if "goodies" in meta:
|
||||
try:
|
||||
get_extra(meta["goodies"][0]["url"], dirn, "booklet.pdf")
|
||||
|
@ -24,6 +24,7 @@ def get_title(track_dict):
|
||||
return title
|
||||
|
||||
|
||||
# Use KeyError catching instead of dict.get to avoid empty tags
|
||||
def tag_flac(filename, root_dir, final_name, d, album, istrack=True, em_image=False):
|
||||
"""
|
||||
Tag a FLAC file
|
||||
@ -61,13 +62,13 @@ def tag_flac(filename, root_dir, final_name, d, album, istrack=True, em_image=Fa
|
||||
audio["ALBUMARTIST"] = d["album"]["artist"]["name"] # ALBUM ARTIST
|
||||
audio["TRACKTOTAL"] = str(d["album"]["tracks_count"]) # TRACK TOTAL
|
||||
audio["ALBUM"] = d["album"]["title"] # ALBUM TITLE
|
||||
audio["YEAR"] = d["album"]["release_date_original"].split("-")[0]
|
||||
audio["DATE"] = d["album"]["release_date_original"].split("-")[0]
|
||||
else:
|
||||
audio["GENRE"] = ", ".join(album["genres_list"]) # GENRE
|
||||
audio["ALBUMARTIST"] = album["artist"]["name"] # ALBUM ARTIST
|
||||
audio["TRACKTOTAL"] = str(album["tracks_count"]) # TRACK TOTAL
|
||||
audio["ALBUM"] = album["title"] # ALBUM TITLE
|
||||
audio["YEAR"] = album["release_date_original"].split("-")[0] # YEAR
|
||||
audio["DATE"] = album["release_date_original"].split("-")[0]
|
||||
|
||||
if em_image:
|
||||
emb_image = os.path.join(root_dir, "cover.jpg")
|
||||
|
Loading…
Reference in New Issue
Block a user