From 000a6c0dbaaa321cf528b7db662eccdd693a7fdf Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Fri, 17 May 2024 18:24:56 +0200 Subject: [PATCH] feat: added type identifier to option strings --- music_kraken/objects/song.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/music_kraken/objects/song.py b/music_kraken/objects/song.py index 2aa8438..980bc08 100644 --- a/music_kraken/objects/song.py +++ b/music_kraken/objects/song.py @@ -219,7 +219,8 @@ class Song(Base): @property def option_string(self) -> str: - r = OPTION_FOREGROUND.value + self.title_string + BColors.ENDC.value + OPTION_BACKGROUND.value + r = "song " + r += OPTION_FOREGROUND.value + self.title_string + BColors.ENDC.value + OPTION_BACKGROUND.value r += get_collection_string(self.album_collection, " from {}", ignore_titles={self.title}) r += get_collection_string(self.artist_collection, " by {}") r += get_collection_string(self.feature_artist_collection, " feat. {}" if len(self.artist_collection) > 0 else " by {}") @@ -369,9 +370,11 @@ class Album(Base): @property def option_string(self) -> str: - r = OPTION_FOREGROUND.value + self.title_string + BColors.ENDC.value + OPTION_BACKGROUND.value + r = "album " + r += OPTION_FOREGROUND.value + self.title_string + BColors.ENDC.value + OPTION_BACKGROUND.value r += get_collection_string(self.artist_collection, " by {}") - r += get_collection_string(self.feature_artist_collection, " feat. {}" if len(self.artist_collection) > 0 else " by {}") + if len(self.artist_collection) <= 0: + r += get_collection_string(self.feature_artist_collection, " by {}") r += get_collection_string(self.label_collection, " under {}") if len(self.song_collection) > 0: @@ -627,7 +630,8 @@ class Artist(Base): @property def option_string(self) -> str: - r = OPTION_FOREGROUND.value + self.title_string + BColors.ENDC.value + OPTION_BACKGROUND.value + r = "artist " + r += OPTION_FOREGROUND.value + self.title_string + BColors.ENDC.value + OPTION_BACKGROUND.value r += get_collection_string(self.label_collection, " under {}") r += OPTION_BACKGROUND.value @@ -720,4 +724,4 @@ class Label(Base): @property def option_string(self): - return OPTION_FOREGROUND.value + self.name + BColors.ENDC.value + return "label " + OPTION_FOREGROUND.value + self.name + BColors.ENDC.value