#36 Play statistics and song ratings


I would like to use subsonic as a replacement for radio. If we extend the subsonic server so that collects play statistics about songs then we generate automatic play lists based on the user's preferences.

It could be implemented as in Amarok. Thereto we mainly need to store three values song and user:
- play_counter: number of times the song was played
- access_date: date when the song was played last
- rating: value between 0 and 100 representing the user preference

In Amarok each song gets an initial rating of 50 and whenever a song is played its rating gets updated according to how long it was played (relatively to the song length) before for user eventually skipped the song. Amarok expresses this user decision in a percentage value, which is 100 if the user did not skip the song at all, and 0 if the user skipped the song already at the beginning. Afterwards Amarok calculates the new song rating as the average between the old rating and the current user decision (percentage value).

Based on the play_counter, access_date, and rating we can automatically generate dynamic play lists that follows the user's preferences, i.e. song with a high rating are played more often than songs with a low rating.

For generating such dynamic play lists in Amarok I used the following SQL formula for ordering the songs: sqrt(s.rating-20)pow([currentTime]-s.access_date,0.8)(0.5rand()+0.5+0.1greatest(0,4-s.play_counter))

It contains the ideas above and tries to play new songs (songs that were not yet played 4 times) more often. Moreover it contains a bit random.



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks