martindale/soundtrack.io — pull request #104 by martindale (2014-06-13 02:56:48+00:00)
Title: Refactor; Track+Artist Sourcing & Rotation

This is the bulk of changes that've taken place on the soundtrack.io server that implement better track and artist sourcing (aggregation of data from remote sources) and rotation (automatic selection of a suitable audio source (per client).

- When a new Artist is discovered, preemptively collect a list of available Tracks by that Artist.
- When a new Track is discovered, preemptively gather a list of available Sources for that Track.

The strategy is currently as follows; 1) gather from last.fm a list of the top 100 most-played tracks by that Artist, 2) determine which of those tracks have available audio Sources (on YouTube or Soundcloud), 3) insert _only_ tracks that have playable audio sources.

Generally, Sources (a video or mp3 url) that have exact same title and are within a 5% variance of the original Track's purported length (as reported by last.fm) will now be automatically merged into the Track as an "available audio source". The client will attempt to play the first of these audio sources when a Track is at the top of the Queue, and then will fail over to the sequential sources.

**TODO**
- [ ] more intelligence source selection (prefer higher bitrate, select "free" sources that are not limited by device / location)