Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
amogus07 committed Jul 19, 2024
2 parents f94a3e2 + 1baa6b0 commit d200b49
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions beetsplug/utaitedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@ def get_artists(self, artists, album=False, comp=False):
"composers": {},
"lyricists": {},
}
composers, producers = [], []
for artist in artists:
parent = artist.get("artist", {})
if parent:
Expand All @@ -500,14 +499,10 @@ def get_artists(self, artists, album=False, comp=False):
else:
name = artist.get("name", "")
id = ""
if "Producer" in artist["categories"]:
if "Producer" in artist["categories"] or "Band" in artist["categories"]:
if "Default" in artist["effectiveRoles"]:
artist["effectiveRoles"] += ",Arranger,Composer,Lyricist"
out["producers"][name] = id
if "Composer" in artist["effectiveRoles"]:
composers.append(name)
else:
producers.append(name)
if "Circle" in artist["categories"]:
out["circles"][name] = id
if "Arranger" in artist["effectiveRoles"]:
Expand All @@ -518,6 +513,8 @@ def get_artists(self, artists, album=False, comp=False):
out["lyricists"][name] = id
if "Vocalist" in artist["categories"] and not artist["isSupport"]:
out["vocalists"][name] = id
if not out["producers"] and out["vocalists"]:
out["producers"] = out["vocalists"]
if not out["arrangers"]:
out["arrangers"] = out["producers"]
if not out["composers"]:
Expand All @@ -526,11 +523,15 @@ def get_artists(self, artists, album=False, comp=False):
out["lyricists"] = out["producers"]
if comp or len(out["producers"]) > 5:
return out, "Various artists"
artistString = ", ".join(composers + producers + list(out["circles"].keys()))
artistString = ", ".join(
list(out["producers"].keys()) + list(out["circles"].keys())
)
if not album and out["vocalists"]:
artistString += " feat. " + ", ".join(
[name for name in out["vocalists"] if name not in out["producers"]]
)
featuring = [
name for name in out["vocalists"] if name not in out["producers"]
]
if featuring:
artistString += " feat. " + ", ".join(featuring)
return out, artistString

def get_genres(self, info):
Expand Down

0 comments on commit d200b49

Please sign in to comment.