cashmusic / platform

A free and open platform giving all musicians access to tools that let them manage, promote, and sell their music online.
https://cashmusic.org
Other
1.33k stars 266 forks source link

Playlist manager #189

Open jessevondoom opened 12 years ago

jessevondoom commented 12 years ago

The playlist manager will serve a few purposes:

In the platform playlists are basically a single asset like any other, with sub-assets (files, like releases), and we'll store data like track order, asset IDs, etc in JSON as we do with releases. So the manager will put an interface on that.

We'll see if we can tackle this once we have the uploader done. Might be better to wait, given that we'd also need to output the playlists, etc. Consider this a stub that'll get expanded.

oknoway commented 12 years ago

I think this will be really easy… we get sorting, dragging, and dropping for free with jQuery UI.

jessevondoom commented 12 years ago

Oh rad...then fuck it — I'll commit to the front-end player stuff if we can make the admin happen. RAD

oknoway commented 12 years ago

I mean, re-ordering the <li>s that contain the track names will be simple.

How is the track order saved? Hidden input(s)?

jessevondoom commented 12 years ago

However's easiest, really. A single string in a hidden input of each sub-asset's ID in order and I can parse on submit. We'll store it as an array in metadata JSON and I'll pull all child assets to get details for each track...

jessevondoom commented 12 years ago

That pre-coffee comment might be a little confusing. Basically however you can keep track of the order works for me. We should be able to parse it on the PHP side and storage/retrieval won't be an issue there. The trickiest part would be that we'll want to store the ID for the track asset more than the name itself, so we'll have to have some kind of hidden field inside the <li> that stores track ID...

oknoway commented 12 years ago

Easy peasy… whatever element that contains everything for the track (likely the <li>) we'll just add an attribute data-diy-track-id="666".

jQuery automatically populates it's own data object with data attributes, so on submit, we can just fill it with $(element).data('diy-track-id')

jessevondoom commented 11 years ago

Am I crazy to be looking at this instead of jQuery UI? http://farhadi.ir/projects/html5sortable/

Don't really care about code size. Just want the easiest drag/sort style list we can muster. TO THE RESEARCHMOBILE!