DroptuneHQ / droptune-og

New music notifications for Spotify & Apple Music. Follow your favorite artists so you never miss a beat.
https://droptune.co
MIT License
93 stars 16 forks source link

show only 1 artist per name #84

Closed bsharpe closed 5 years ago

bsharpe commented 5 years ago

apparently, there are multiple artists records with the same name (looks like 1 per music service). Which can currently be seen in the Artists tab of people you follow.

adding SELECT DISTINCT ON ("artists"."name") * to query to only show 1 per unique name.

Shpigford commented 5 years ago

Had to revert. I'm not sure what the SELECT was ultimately pulling, but it resulted in linking to the incorrect ID of the artist.

Artist.followed_by(@user).with_name.order(name: :asc).uniq

That technically works but not sure how it is comparatively on performance.