FabricLabs / soundtrack

Self-hosted collaborative music playing application.
https://soundtrack.io
126 stars 52 forks source link

Single Sources Array #78

Open martindale opened 10 years ago

martindale commented 10 years ago

Currently, the "sources" property of a track is a map of the sources:

track = {
  [...],
  sources: {
    youtube: [ { id: 'dVy...' }, [...] ],
    soundcloud: [ { id: 125... }, [...] ]
  }
}

It should instead be a flat array, ordered by quality / reliability / preference:

track = {
  [...],
  sources: [
    { type: 'video/youtube', id: 'dVy...',  uri: 'http://s.youtube.com/v/dVy...' },
    { type: 'video/youtube', id: 'xQr...',  uri: 'http://s.youtube.com/v/xQr...' },
    { type: 'audio/mp3', id: 125...,  uri: 'http://stream.soundcloud.com/125...' },
    { type: 'audio/mp3', uri: 'http://someserver.io/remote-file.mp3' }
  ]
}
martindale commented 10 years ago

@unusualbob and @synthesize -- this is probably going to break the Python and Android clients, so I've logged it as an issue here before moving forward with it.