We're updating the issue view to help you get more done. 

Exporting Play Queue Doesn't Preserve Track Ordering

Description

If you export your playlist into a url (e.g. groovebox.org?queue=693756,693760,693761), you are telling groovebox to fill the play queue with the tracks having ids 693756, 693760, 693761 upon page load. (in groovebox.js)

However, these ids are not guaranteed to load in the order specified because the AJAX request to fetch track metadata is done asynchronously and thus one request may complete before another.

One solution is to have the equivalent of a .finish on the entire block which does a map over the aggregated list of tracks and reorders the play queue.

Another option is to pre-populate the play queue with stubs (indexed correctly by the track ids) and then update this data structure as the ajax requests complete. This may result in dangling IDs and will complicate the "autoplay" feature of groovebox's page load.

Environment

None

Status

Assignee

Unassigned

Reporter

Mek Karpeles

Labels

None

Priority

Minor