From 8b945f7c4cfffe841217c97078792038519a487c Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 22 Mar 2020 17:02:33 +0100 Subject: [PATCH] Added option to move featured to title 0 => do not change 1 => remove from title 2 => add to title --- deemix/app/downloader.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/deemix/app/downloader.py b/deemix/app/downloader.py index 46af0b9..616a71a 100644 --- a/deemix/app/downloader.py +++ b/deemix/app/downloader.py @@ -419,12 +419,19 @@ def downloadTrackObj(dz, trackAPI, settings, overwriteBitrate=False, extraTrack= track['dateString'] = formatDate(track['date'], settings['dateFormat']) track['album']['dateString'] = formatDate(track['album']['date'], settings['dateFormat']) + # Check if user wants the feat in the title + # 0 => do not change + # 1 => remove from title + # 2 => add to title + if settings['featuredToTitle'] == "1": + track['title'] = track['title_clean'] + elif settings['featuredToTitle'] == "2": + track['title'] = track['title_feat'] + # Remove (Album Version) from tracks that have that if settings['removeAlbumVersion']: if "Album Version" in track['title']: track['title'] = re.sub(r' ?\(Album Version\)', "", track['title']).strip() - track['title_clean'] = re.sub(r' ?\(Album Version\)', "", track['title_clean']).strip() - track['title_feat'] = re.sub(r' ?\(Album Version\)', "", track['title_feat']).strip() # Generate filename and filepath from metadata filename = generateFilename(track, trackAPI, settings) @@ -461,7 +468,7 @@ def downloadTrackObj(dz, trackAPI, settings, overwriteBitrate=False, extraTrack= if settings['multitagSeparator'] != "default": if settings['multitagSeparator'] == "andFeat": track['artistsString'] = track['mainArtistsString'] - if 'featArtistsString' in track: + if 'featArtistsString' in track and settings['featuredToTitle'] != "2": track['artistsString'] += " "+track['featArtistsString'] else: track['artistsString'] = settings['multitagSeparator'].join(track['artists'])