From 505111db922055d2ff1eabde799219548233c90f Mon Sep 17 00:00:00 2001 From: nathom Date: Tue, 30 Mar 2021 14:31:35 -0700 Subject: [PATCH] Fix issue where cover art message displayed before album --- streamrip/db.py | 2 ++ streamrip/downloader.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/streamrip/db.py b/streamrip/db.py index d607eab..dec59e2 100644 --- a/streamrip/db.py +++ b/streamrip/db.py @@ -37,6 +37,7 @@ class MusicDB: :type item_id: str :rtype: bool """ + logger.debug(f"Checking database for ID {item_id}") with sqlite3.connect(self.path) as conn: return ( conn.execute( @@ -51,6 +52,7 @@ class MusicDB: :param item_id: :type item_id: str """ + logger.debug(f"Adding ID {item_id}") with sqlite3.connect(self.path) as conn: try: conn.execute( diff --git a/streamrip/downloader.py b/streamrip/downloader.py index ad14433..5d8efe4 100644 --- a/streamrip/downloader.py +++ b/streamrip/downloader.py @@ -822,6 +822,8 @@ class Album(Tracklist): cover = None cover_path = os.path.join(folder, "cover.jpg") + self.download_message() + if os.path.isfile(cover_path): logger.debug("Cover already downloaded: %s. Skipping", cover_path) else: @@ -847,7 +849,6 @@ class Album(Tracklist): if self.client.source != "deezer": cover = self.get_cover_obj(cover_path, quality) - self.download_message() for track in self: logger.debug("Downloading track to %s", folder) track.download( @@ -1199,7 +1200,6 @@ class Artist(Tracklist): self.download_message() for album in final: - click.secho(f"Downloading album: {album}", fg="blue") try: album.load_meta() except NonStreamable: