play/play — pull request #189 by derekgr (2012-08-24 19:20:54+00:00)
Title: Add simple counters for time-based track stats

There's some great music in the play queue, but people's tastes change over time. I wanted to get some simple metrics from play, such as popular tracks for a given time range. This PR adds track scoring in per-day buckets on top of Redis sorted sets, as well as API commands to return a list of popular tracks over a variable lookback period, and to queue a selection of tracks from the popular list.

A track's score increases by one when it is queued by a user, and by `History::STAR_WEIGHT` when a user stars (unstarring decreases the score by the same amount).

This should allow people to implicitly vote for songs they like (by queueing them) or explicitly (by starring), and then provide visibility into what Play users as a whole are currently enjoying.

Answer questions like:
- Which is the more popular troll method this week, Gimme Pizza or Call Me Maybe?
- Is the office currently reppin' West Coast, East Coast, or Dirty South?
- Does LCD Soundsystem still have It?