From 1e62d371cdd7712158ec3a1b731d05bf9793e6ec Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Fri, 19 Apr 2024 11:46:56 +0200 Subject: [PATCH] feat: cleaned bandcamp songs --- music_kraken/pages/bandcamp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/music_kraken/pages/bandcamp.py b/music_kraken/pages/bandcamp.py index f9a3a45..a583cd9 100644 --- a/music_kraken/pages/bandcamp.py +++ b/music_kraken/pages/bandcamp.py @@ -22,6 +22,7 @@ from ..objects import ( ) from ..connection import Connection from ..utils.support_classes.download_result import DownloadResult +from ..utils.string_processing import clean_song_title from ..utils.config import main_settings, logging_settings from ..utils.shared import DEBUG @@ -114,7 +115,7 @@ class Bandcamp(Page): if object_type is BandcampTypes.SONG: return Song( - title=name.strip(), + title=clean_song_title(name, artist_name=data["band_name"]), source_list=source_list, main_artist_list=[ Artist( @@ -254,7 +255,7 @@ class Bandcamp(Page): def _parse_track_element(self, track: dict) -> Optional[Song]: return Song( - title=track["item"]["name"].strip(), + title=clean_song_title(track["item"]["name"]), source_list=[Source(self.SOURCE_TYPE, track["item"]["mainEntityOfPage"])], tracksort=int(track["position"]) ) @@ -337,7 +338,7 @@ class Bandcamp(Page): mp3_url = value song = Song( - title=data["name"].strip(), + title=clean_song_title(data["name"], artist_name=artist_data["name"]), source_list=[Source(self.SOURCE_TYPE, data.get("mainEntityOfPage", data["@id"]), audio_url=mp3_url)], album_list=[Album( title=album_data["name"].strip(),