Keep "Various Aritsts" tag only if it's the only artist in the track
This fixes #21
This commit is contained in:
parent
fd148d481c
commit
2552f0787d
|
@ -335,7 +335,7 @@ def getTrackData(dz, trackAPI_gw, trackAPI=None, albumAPI_gw=None, albumAPI=None
|
||||||
track['artist'] = {}
|
track['artist'] = {}
|
||||||
track['artists'] = []
|
track['artists'] = []
|
||||||
for artist in trackAPI['contributors']:
|
for artist in trackAPI['contributors']:
|
||||||
if artist['id'] != 5080:
|
if artist['id'] != 5080 or artist['id'] == 5080 and len(trackAPI['contributors']) == 1:
|
||||||
track['artists'].append(artist['name'])
|
track['artists'].append(artist['name'])
|
||||||
if not artist['role'] in track['artist']:
|
if not artist['role'] in track['artist']:
|
||||||
track['artist'][artist['role']] = []
|
track['artist'][artist['role']] = []
|
||||||
|
|
|
@ -13,7 +13,7 @@ def tagID3(stream, track, save):
|
||||||
|
|
||||||
if save['title']:
|
if save['title']:
|
||||||
tag.add(TIT2(text=track['title']))
|
tag.add(TIT2(text=track['title']))
|
||||||
if save['artist']:
|
if save['artist'] and len(track['artists']):
|
||||||
if save['multitagSeparator'] != "default":
|
if save['multitagSeparator'] != "default":
|
||||||
tag.add(TPE1(text=track['artistsString']))
|
tag.add(TPE1(text=track['artistsString']))
|
||||||
tag.add(TXXX(desc="ARTISTS", text=track['artists']))
|
tag.add(TXXX(desc="ARTISTS", text=track['artists']))
|
||||||
|
@ -21,7 +21,7 @@ def tagID3(stream, track, save):
|
||||||
tag.add(TPE1(text=track['artists']))
|
tag.add(TPE1(text=track['artists']))
|
||||||
if save['album']:
|
if save['album']:
|
||||||
tag.add(TALB(text=track['album']['title']))
|
tag.add(TALB(text=track['album']['title']))
|
||||||
if save['albumArtist']:
|
if save['albumArtist'] and len(track['album']['artists']):
|
||||||
tag.add(TPE2(text=track['album']['artists']))
|
tag.add(TPE2(text=track['album']['artists']))
|
||||||
if save['trackNumber']:
|
if save['trackNumber']:
|
||||||
tag.add(TRCK(
|
tag.add(TRCK(
|
||||||
|
@ -79,7 +79,7 @@ def tagFLAC(stream, track, save):
|
||||||
tag.clear_pictures()
|
tag.clear_pictures()
|
||||||
if save['title']:
|
if save['title']:
|
||||||
tag["TITLE"] = track['title']
|
tag["TITLE"] = track['title']
|
||||||
if save['artist']:
|
if save['artist'] and len(track['artists']):
|
||||||
if save['multitagSeparator'] != "default":
|
if save['multitagSeparator'] != "default":
|
||||||
tag["ARTIST"] = track['artistsString']
|
tag["ARTIST"] = track['artistsString']
|
||||||
tag["ARTISTS"] = track['artists']
|
tag["ARTISTS"] = track['artists']
|
||||||
|
@ -87,7 +87,7 @@ def tagFLAC(stream, track, save):
|
||||||
tag["ARTIST"] = track['artists']
|
tag["ARTIST"] = track['artists']
|
||||||
if save['album']:
|
if save['album']:
|
||||||
tag["ALBUM"] = track['album']['title']
|
tag["ALBUM"] = track['album']['title']
|
||||||
if save['albumArtist']:
|
if save['albumArtist'] and len(track['album']['artists']):
|
||||||
tag["ALBUMARTIST"] = track['album']['artists']
|
tag["ALBUMARTIST"] = track['album']['artists']
|
||||||
if save['trackNumber']:
|
if save['trackNumber']:
|
||||||
tag["TRACKNUMBER"] = str(track['trackNumber'])
|
tag["TRACKNUMBER"] = str(track['trackNumber'])
|
||||||
|
|
Loading…
Reference in New Issue