Renamed multitagSeparator to multiArtistSeparator

as it only affects artists
Added singleAlbumArtist that saves only the main artist in the 
albumartist field
This commit is contained in:
RemixDev 2020-07-18 17:28:51 +02:00
parent bc59fb8906
commit 492b1dbc23
3 changed files with 23 additions and 10 deletions

View File

@ -69,6 +69,7 @@
"savePlaylistAsCompilation": false,
"useNullSeparator": false,
"saveID3v1": true,
"multitagSeparator": "default"
"multiArtistSeparator": "default",
"singleAlbumArtist": false,
}
}

View File

@ -672,13 +672,13 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
track['title'] = re.sub(r' ?\(Album Version\)', "", track['title']).strip()
# Generate artist tag if needed
if settings['tags']['multitagSeparator'] != "default":
if settings['tags']['multitagSeparator'] == "andFeat":
if settings['tags']['multiArtistSeparator'] != "default":
if settings['tags']['multiArtistSeparator'] == "andFeat":
track['artistsString'] = track['mainArtistsString']
if 'featArtistsString' in track and settings['featuredToTitle'] != "2":
track['artistsString'] += " " + track['featArtistsString']
else:
track['artistsString'] = settings['tags']['multitagSeparator'].join(track['artists'])
track['artistsString'] = settings['tags']['multiArtistSeparator'].join(track['artists'])
else:
track['artistsString'] = ", ".join(track['artists'])

View File

@ -14,7 +14,10 @@ def tagID3(stream, track, save):
if save['title']:
tag.add(TIT2(text=track['title']))
if save['artist'] and len(track['artists']):
if save['multitagSeparator'] != "default":
if save['multiArtistSeparator'] != "default":
if save['multiArtistSeparator'] == "nothing":
tag.add(TPE1(text=track['mainArtist']['name']))
else:
tag.add(TPE1(text=track['artistsString']))
tag.add(TXXX(desc="ARTISTS", text=track['artists']))
else:
@ -22,6 +25,9 @@ def tagID3(stream, track, save):
if save['album']:
tag.add(TALB(text=track['album']['title']))
if save['albumArtist'] and len(track['album']['artists']):
if save['singleAlbumArtist']:
tag.add(TPE2(text=track['album']['mainArtist']['name']))
else:
tag.add(TPE2(text=track['album']['artists']))
if save['trackNumber']:
tag.add(TRCK(
@ -80,7 +86,10 @@ def tagFLAC(stream, track, save):
if save['title']:
tag["TITLE"] = track['title']
if save['artist'] and len(track['artists']):
if save['multitagSeparator'] != "default":
if save['multiArtistSeparator'] != "default":
if save['multiArtistSeparator'] == "nothing":
tag["ARTIST"] = track['mainArtist']['name']
else:
tag["ARTIST"] = track['artistsString']
tag["ARTISTS"] = track['artists']
else:
@ -88,6 +97,9 @@ def tagFLAC(stream, track, save):
if save['album']:
tag["ALBUM"] = track['album']['title']
if save['albumArtist'] and len(track['album']['artists']):
if save['singleAlbumArtist']:
tag["ALBUMARTIST"] = track['album']['mainArtist']['name']
else:
tag["ALBUMARTIST"] = track['album']['artists']
if save['trackNumber']:
tag["TRACKNUMBER"] = str(track['trackNumber'])