From 08b94924550b78b761c41dca9f250179ffd8fb04 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Tue, 7 May 2024 13:55:09 +0200 Subject: [PATCH] fix: am source thing --- music_kraken/pages/abstract.py | 1 + music_kraken/utils/__init__.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/music_kraken/pages/abstract.py b/music_kraken/pages/abstract.py index 0ea15db..365fe02 100644 --- a/music_kraken/pages/abstract.py +++ b/music_kraken/pages/abstract.py @@ -403,6 +403,7 @@ class Page: self.LOGGER.info(f"{song.option_string} already exists, thus not downloading again.") return r + source = None if not found_on_disc: for source in sources: r = self.download_song_to_target(source=source, target=temp_target, desc=song.option_string) diff --git a/music_kraken/utils/__init__.py b/music_kraken/utils/__init__.py index e85fa1a..a8d658b 100644 --- a/music_kraken/utils/__init__.py +++ b/music_kraken/utils/__init__.py @@ -19,8 +19,13 @@ def _apply_color(msg: str, color: BColors) -> str: if not isinstance(msg, str): msg = str(msg) + endc = BColors.ENDC.value + if color is BColors.ENDC: return msg + + msg = msg.replace(BColors.ENDC.value, BColors.ENDC.value + color.value) + return color.value + msg + BColors.ENDC.value