summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/playlist.js4
-rw-r--r--static/sound.js4
2 files changed, 6 insertions, 2 deletions
diff --git a/static/playlist.js b/static/playlist.js
index 99ec6c5..6f57075 100644
--- a/static/playlist.js
+++ b/static/playlist.js
@@ -25,6 +25,7 @@ $(function(){
}
});
PlaylistView = Backbone.View.extend({
+ current_id: 1,
el: $('#playlist'),
initialize: function() {
items.bind('add', this.addOne, this);
@@ -34,6 +35,9 @@ $(function(){
items.fetch();
},
add: function(item) {
+ item.track_id = item.id;
+ item.id = this.current_id;
+ this.current_id++;
var model = items.create(item);
},
addOne: function(item) {
diff --git a/static/sound.js b/static/sound.js
index 252741c..874c213 100644
--- a/static/sound.js
+++ b/static/sound.js
@@ -1,6 +1,6 @@
function playsound(model) {
var item = model.toJSON();
- var id = item.id;
+ var id = item.track_id;
var cid = model.cid;
var el = $('#cid-' + cid);
el.addClass('loading');
@@ -10,7 +10,7 @@ function playsound(model) {
}
sound = soundManager.createSound({
id: 'audio',
- url: '/track/' + item.id,
+ url: '/track/' + id,
whileloading: function() {
$('#status').text('Loading... ' + this.bytesLoaded);
el.addClass('loading');