programsam / binkjs

Music archival site BINK, rewritten as a Node.js express app
0 stars 1 forks source link

New media should be ordered by how it is selected #131

Closed programsam closed 3 years ago

programsam commented 3 years ago

Right now, whichever track finishes uploading first will get the first number in the track list — so smaller ones will end up with smaller numbers. The idea here would be to look at their index in the req.files array and use that as the number so they don’t get out of order.

programsam commented 3 years ago

There is no way to guarantee it'll be uploaded in this order. Especially if you make a DropZone that uploads multiple files at the same time. So you're either doing them one-by-one or you're allowing them to go up all in async fashion. In the later case, it's impossible to know which one is supposed to go first unless you look at the first three characters of the uploaded file name, which we do. See #128 for more info. This is done.