From e0581259a68d96f15f834d092a4441c883f918bb Mon Sep 17 00:00:00 2001 From: thecookingsenpai Date: Tue, 30 Jan 2024 15:51:05 +0100 Subject: [PATCH] Just some formatting change and utilities for the next step --- app/lib/populate.py | 4 +++- app/settings.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/lib/populate.py b/app/lib/populate.py index d5bb4fc..012340b 100644 --- a/app/lib/populate.py +++ b/app/lib/populate.py @@ -104,8 +104,9 @@ class Populate: log.error( "Internet connection lost. Downloading artist images stopped." ) + log.error(e) # REVIEW More informations = good else: - log.warning(f"No internet connection. Downloading artist images stopped!") + log.warning("No internet connection. Downloading artist images stopped!") # Re-process the new artist images. if tried_to_download_new_images: @@ -135,6 +136,7 @@ class Populate: unmodified_paths.add(track.filepath) continue except (FileNotFoundError, OSError) as e: + log.warning(e) # REVIEW More informations = good TrackStore.remove_track_obj(track) remove_tracks_by_filepaths(track.filepath) diff --git a/app/settings.py b/app/settings.py index 13cf572..bfe62a4 100644 --- a/app/settings.py +++ b/app/settings.py @@ -242,6 +242,9 @@ class Keys: @classmethod def load(cls): + # TODO Remove this. Just an handy flag to test the app without the API key + # IS_BUILD = True + if IS_BUILD: cls.LASTFM_API_KEY = configs.LASTFM_API_KEY cls.PLUGIN_LYRICS_AUTHORITY = configs.PLUGIN_LYRICS_AUTHORITY @@ -253,7 +256,8 @@ class Keys: @classmethod def verify_keys(cls): if not cls.LASTFM_API_KEY: - print("ERROR: LASTFM_API_KEY not set in environment") + # REVIEW Ideally, this shouldn't be fatal + print("WARNING: LASTFM_API_KEY not set in environment. Experimental API calls will be implemented") sys.exit(0) @classmethod