diff --git a/app/models.py b/app/models.py index a16cad6..f5e5779 100644 --- a/app/models.py +++ b/app/models.py @@ -59,9 +59,10 @@ class Track: def __post_init__(self): if self.artist is not None: artists = utils.split_artists(self.artist) + featured = utils.extract_featured_artists_from_title(self.title) - artists.extend(featured) - artists = set(artists) + original_lower = "-".join([a.lower() for a in artists]) + artists.extend([a for a in featured if a.lower() not in original_lower]) self.artist_hashes = [utils.create_hash(a, decode=True) for a in artists] diff --git a/app/utils.py b/app/utils.py index 95d7886..8be1836 100644 --- a/app/utils.py +++ b/app/utils.py @@ -260,7 +260,7 @@ def is_windows(): def split_artists(src: str): - artists = re.split(r"\s*[&,;/]\s*", src) + artists = re.split(r"\s*[&,;]\s*", src) return [a.strip() for a in artists]