Fix issue where cover art message displayed before album

This commit is contained in:
nathom 2021-03-30 14:31:35 -07:00
parent b844931528
commit 505111db92
2 changed files with 4 additions and 2 deletions

View file

@ -37,6 +37,7 @@ class MusicDB:
:type item_id: str :type item_id: str
:rtype: bool :rtype: bool
""" """
logger.debug(f"Checking database for ID {item_id}")
with sqlite3.connect(self.path) as conn: with sqlite3.connect(self.path) as conn:
return ( return (
conn.execute( conn.execute(
@ -51,6 +52,7 @@ class MusicDB:
:param item_id: :param item_id:
:type item_id: str :type item_id: str
""" """
logger.debug(f"Adding ID {item_id}")
with sqlite3.connect(self.path) as conn: with sqlite3.connect(self.path) as conn:
try: try:
conn.execute( conn.execute(

View file

@ -822,6 +822,8 @@ class Album(Tracklist):
cover = None cover = None
cover_path = os.path.join(folder, "cover.jpg") cover_path = os.path.join(folder, "cover.jpg")
self.download_message()
if os.path.isfile(cover_path): if os.path.isfile(cover_path):
logger.debug("Cover already downloaded: %s. Skipping", cover_path) logger.debug("Cover already downloaded: %s. Skipping", cover_path)
else: else:
@ -847,7 +849,6 @@ class Album(Tracklist):
if self.client.source != "deezer": if self.client.source != "deezer":
cover = self.get_cover_obj(cover_path, quality) cover = self.get_cover_obj(cover_path, quality)
self.download_message()
for track in self: for track in self:
logger.debug("Downloading track to %s", folder) logger.debug("Downloading track to %s", folder)
track.download( track.download(
@ -1199,7 +1200,6 @@ class Artist(Tracklist):
self.download_message() self.download_message()
for album in final: for album in final:
click.secho(f"Downloading album: {album}", fg="blue")
try: try:
album.load_meta() album.load_meta()
except NonStreamable: except NonStreamable: