From 5404ccaf9dd38b8d4e93c30ea8f3a7cc3279a2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Wed, 15 Dec 2021 15:10:28 +0100 Subject: [PATCH] Print "No Genres found for song" to own channel --- zspotify/config.py | 2 ++ zspotify/termoutput.py | 1 + zspotify/track.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/zspotify/config.py b/zspotify/config.py index 429a85b6..dd82564c 100644 --- a/zspotify/config.py +++ b/zspotify/config.py @@ -30,6 +30,7 @@ TEMP_DOWNLOAD_DIR = 'TEMP_DOWNLOAD_DIR' MD_ALLGENRES = 'MD_ALLGENRES' MD_GENREDELIMITER = 'MD_GENREDELIMITER' PRINT_PROGRESS_INFO = 'PRINT_PROGRESS_INFO' +PRINT_WARNINGS = 'PRINT_WARNINGS' CONFIG_VALUES = { ROOT_PATH: { 'default': '../ZSpotify Music/', 'type': str, 'arg': '--root-path' }, @@ -55,6 +56,7 @@ CONFIG_VALUES = { PRINT_DOWNLOADS: { 'default': 'False', 'type': bool, 'arg': '--print-downloads' }, PRINT_API_ERRORS: { 'default': 'False', 'type': bool, 'arg': '--print-api-errors' }, PRINT_PROGRESS_INFO: { 'default': 'True', 'type': bool, 'arg': '--print-progress-info' }, + PRINT_WARNINGS: { 'default': 'True', 'type': bool, 'arg': '--print-warnings' }, MD_ALLGENRES: { 'default': 'False', 'type': bool, 'arg': '--md-allgenres' }, MD_GENREDELIMITER: { 'default': ';', 'type': str, 'arg': '--md-genredelimiter' }, TEMP_DOWNLOAD_DIR: { 'default': '', 'type': str, 'arg': '--temp-download-dir' } diff --git a/zspotify/termoutput.py b/zspotify/termoutput.py index 2615531e..be463564 100644 --- a/zspotify/termoutput.py +++ b/zspotify/termoutput.py @@ -10,6 +10,7 @@ class PrintChannel(Enum): SKIPS = PRINT_SKIPS DOWNLOAD_PROGRESS = PRINT_DOWNLOAD_PROGRESS ERRORS = PRINT_ERRORS + WARNINGS = PRINT_WARNINGS DOWNLOADS = PRINT_DOWNLOADS API_ERRORS = PRINT_API_ERRORS PROGRESS_INFO = PRINT_PROGRESS_INFO diff --git a/zspotify/track.py b/zspotify/track.py index c50afb5f..c6cf7aad 100644 --- a/zspotify/track.py +++ b/zspotify/track.py @@ -58,7 +58,7 @@ def get_song_info(song_id) -> Tuple[List[str], List[str], str, str, Any, Any, An genres.append(artistInfo[GENRES][0]) if len(genres) == 0: - Printer.print(PrintChannel.SKIPS, '### No Genre found.') + Printer.print(PrintChannel.WARNINGS, '### No Genres found for song ' + info[TRACKS][0][NAME]) genres.append('') album_name = info[TRACKS][0][ALBUM][NAME]