From 349d7338b0f292a9c9872f5c3a5c9e6e8429d012 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Thu, 11 Jun 2020 13:06:26 +0200 Subject: [PATCH] Added option to remove featured artists from album title as well --- deemix/app/downloader.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/deemix/app/downloader.py b/deemix/app/downloader.py index fed3be4..0d60256 100644 --- a/deemix/app/downloader.py +++ b/deemix/app/downloader.py @@ -380,6 +380,15 @@ def getTrackData(dz, trackAPI_gw, settings, trackAPI=None, albumAPI_gw=None, alb tempTrack += track['title_clean'][track['title_clean'].find(")", pos + 1) + 1:] track['title_clean'] = tempTrack.strip() + # Remove featuring from the album name + track['album']['title_clean'] = track['album']['title'] + if "(feat." in track['album']['title_clean'].lower(): + pos = track['album']['title_clean'].lower().find("(feat.") + tempTrack = track['album']['title_clean'][:pos] + if ")" in track['album']['title_clean']: + tempTrack += track['album']['title_clean'][track['album']['title_clean'].find(")", pos + 1) + 1:] + track['album']['title_clean'] = tempTrack.strip() + # Create artists strings track['mainArtistsString'] = "" track['commaArtistsString'] = "" @@ -630,10 +639,14 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None # 0 => do not change # 1 => remove from title # 2 => add to title + # 3 => remove from title and album title if settings['featuredToTitle'] == "1": track['title'] = track['title_clean'] elif settings['featuredToTitle'] == "2": track['title'] = track['title_feat'] + elif settings['featuredToTitle'] == "3": + track['title'] = track['title_clean'] + track['album']['title'] = track['album']['title_clean'] # Remove (Album Version) from tracks that have that if settings['removeAlbumVersion']: