Top tracks and featuring

Artist radio, genre radio & related artists. A Subsonic server for music nerds.

Moderator: moderators

Top tracks and featuring

Postby obcd » Fri Nov 30, 2012 9:49 am

Hi,

I have noticed that when I use the "play top tracks" feature, it will not play the tracks where another artist is featured (ABC feat. DEF). Some of such tracks are big hits. I think it would make sense to have them in the top tracks.
obcd
 
Posts: 40
Joined: Mon Nov 19, 2012 2:42 pm

Re: Top tracks and featuring

Postby hakko » Fri Nov 30, 2012 10:12 am

Can you give an example? I wonder if they are returned from last.fm at all in a way that would make it possible to identify them locally.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top tracks and featuring

Postby obcd » Fri Nov 30, 2012 10:18 am

Easy example: Pitbull - Planet Pit (2011)
I have it tagged with Musicbrainz.
Last.fm: http://www.last.fm/music/Pitbull/Planet ... xe+Version)

When I use the top tracks feature, it will only add tracks where there isn't a featured artist.
obcd
 
Posts: 40
Joined: Mon Nov 19, 2012 2:42 pm

Re: Top tracks and featuring

Postby hakko » Fri Nov 30, 2012 11:07 am

I don't see that song returned in the top tracks from last.fm...

http://ws.audioscrobbler.com/2.0/?metho ... 97517b179e

The "ABC feat DEF" is a general problem as it's not really possible to tag properly. Ideally, you'd want to tag such a track as "artist ABC", "featured artist DEF" but right now it becomes a completely new artist instead. Unless you change the song title instead to "artist ABC - track GHI (feat. DEF)" but that's just a variation of a bad solution. I wish there was a widely accepted way of tagging this...
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top tracks and featuring

Postby obcd » Fri Nov 30, 2012 3:24 pm

"Pitbull - Planet Pit (2011)" was just the name of the album so it is not in the list.

From what I understand, the problem is that last.fm says that the artist is "ABC" while in reality it is "ABC feat. DEF". If the album is correctly tagged, the artist of the album will be ABC. I don't really know how your software works, but I guess that you check if the song on the top tracks list is locally in the library. What about checking it with the albumartist tag and not with the artist of the track? It should solve the problem, no?
obcd
 
Posts: 40
Joined: Mon Nov 19, 2012 2:42 pm

Re: Top tracks and featuring

Postby hakko » Sat Dec 01, 2012 10:06 pm

If you feel like helping out experimenting, you could try this:

Play top tracks of an artist (I used Frank Ocean as an example). Note that no tracks with Frank Ocean feat somebody else appear in the playlist.

Run this SQL command in Postgres (just once! it'll say INSERT 0 NNN if successful):

Code: Select all
insert into library.artisttoptrackplaycount (track_id, artist_id, rank, play_count)
select distinct on (lt.track_id) lt.id, aat.artist_id, att.rank, coalesce(tpc.play_count, 0) from library.filetag ft
inner join music.track at on ft.track_id = at.id
inner join music.track aat on ft.album_artist_id = aat.artist_id and at.track_name = aat.track_name
inner join library.track lt on lt.file_id = ft.file_id
inner join music.artisttoptrack att on att.track_id = aat.id and att.artist_id = aat.artist_id
left outer join library.trackplaycount tpc on tpc.track_id = at.id
where ft.artist_id <> ft.album_artist_id;


Play top tracks again. Frank Ocean feat XX now appears in the playlist, if you have Frank Ocean entered as Album Artist. And in artist radio playlists. Correct?

This change will be rolled back on every library scan. I'll try it myself for a while and build some test cases, if it works out well, I'll include it in the next release.

(it could take a little while to run, the database is not really optimized to look for tracks that way. but for now I'm only interested in whether this technique solves your problem)
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top tracks and featuring

Postby obcd » Sun Dec 02, 2012 8:48 pm

My knowledge about SQL is near 0. I logged in as "postgres", entered "psql", then I ran the command. The output:
Code: Select all
ERROR:  schema "library" does not exist
LINE 1: insert into library.artisttoptrackplaycount (track_id, artis...
                    ^
obcd
 
Posts: 40
Joined: Mon Nov 19, 2012 2:42 pm

Re: Top tracks and featuring

Postby hakko » Sun Dec 02, 2012 8:51 pm

Run psql -d musiccabinet to tell which database to operate on. (sorry.. maybe I shouldn't assume everyone enjoys psql)
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top tracks and featuring

Postby obcd » Mon Dec 03, 2012 9:43 am

It works! Awesome!
obcd
 
Posts: 40
Joined: Mon Nov 19, 2012 2:42 pm

Re: Top tracks and featuring

Postby hakko » Mon Dec 03, 2012 1:09 pm

Nice! Note that the change will disappear when you scan your library. So until I've built a new release that does this automatically, you'll have to turn off nightly scanning or do the insert once every morning (with cron).
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top tracks and featuring

Postby hakko » Sun Dec 09, 2012 11:19 am

MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden


Return to MusicCabinet

Who is online

Users browsing this forum: No registered users and 20 guests