diff --git a/spa/models/mix.py b/spa/models/mix.py index 0f79569..1918d35 100644 --- a/spa/models/mix.py +++ b/spa/models/mix.py @@ -141,6 +141,9 @@ class Mix(_BaseModel): try: if user.is_authenticated(): ActivityPlay(user=user.get_profile(), mix=self).save() + else: + ActivityPlay(user=None, mix=self).save() + except Exception, e: self.logger.exception("Unable to add mix play: %s" % e.message) diff --git a/static/js/app/lib/audioController.js b/static/js/app/lib/audioController.js index ff59f7c..ff56d5e 100644 --- a/static/js/app/lib/audioController.js +++ b/static/js/app/lib/audioController.js @@ -1,18 +1,18 @@ -// Generated by CoffeeScript 1.6.2 +// Generated by CoffeeScript 1.3.3 (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; define(['app', 'marionette', 'vent'], function(App, Marionette, vent) { - var AudioController, _ref; - + var AudioController; AudioController = (function(_super) { + __extends(AudioController, _super); function AudioController() { - this.mixInit = __bind(this.mixInit, this); _ref = AudioController.__super__.constructor.apply(this, arguments); - return _ref; + this.mixInit = __bind(this.mixInit, this); + return AudioController.__super__.constructor.apply(this, arguments); } AudioController.prototype.initialize = function(options) { @@ -25,7 +25,6 @@ AudioController.prototype.mixInit = function(model) { var id, _this = this; - console.log("AudioController: mixInit"); id = model.get('id'); return $.getJSON("/ajax/mix_stream_url/" + id + "/", function(data) { diff --git a/static/js/app/views/mix/mixItemView.js b/static/js/app/views/mix/mixItemView.js index 2e14c4b..58a539b 100644 --- a/static/js/app/views/mix/mixItemView.js +++ b/static/js/app/views/mix/mixItemView.js @@ -1,22 +1,26 @@ -// Generated by CoffeeScript 1.6.2 +// Generated by CoffeeScript 1.3.3 (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; define(['moment', 'app', 'vent', 'marionette', 'models/comment/commentCollection', 'views/comment/commentListView', 'text!/tpl/MixListItemView'], function(moment, App, vent, Marionette, CommentsCollection, CommentsListView, Template) { - var MixItemView, _ref; - + var MixItemView; MixItemView = (function(_super) { + __extends(MixItemView, _super); function MixItemView() { this.doStart = __bind(this.doStart, this); + this.renderComments = __bind(this.renderComments, this); + this.renderGenres = __bind(this.renderGenres, this); + this.onRender = __bind(this.onRender, this); - this.initialize = __bind(this.initialize, this); _ref = MixItemView.__super__.constructor.apply(this, arguments); - return _ref; + + this.initialize = __bind(this.initialize, this); + return MixItemView.__super__.constructor.apply(this, arguments); } MixItemView.prototype.template = _.template(Template); @@ -50,7 +54,6 @@ MixItemView.prototype.onRender = function() { var id, totalDuration, totalDurationText; - id = this.model.get('id'); if (this.model.get('duration')) { totalDuration = moment.duration(this.model.get('duration'), "seconds"); @@ -65,7 +68,6 @@ MixItemView.prototype.renderGenres = function() { var el; - el = this.el; $.each(this.model.get("genre-list"), function(data) { $("#genre-list", el).append('' + this.text + ''); @@ -76,7 +78,6 @@ MixItemView.prototype.renderComments = function() { var comments; - comments = new CommentsCollection(); comments.url = this.model.get("resource_uri") + "comments/"; comments.mix_id = this.model.id; @@ -84,7 +85,6 @@ comments.fetch({ success: function(data) { var content; - console.log(data); content = new CommentsListView({ collection: comments @@ -128,7 +128,6 @@ MixItemView.prototype.mixFavourite = function() { var app; - console.log("MixItemView: favouriteMix"); app = require('app'); app.vent.trigger("mix:favourite", this.model); @@ -137,7 +136,6 @@ MixItemView.prototype.mixLike = function() { var app; - console.log("MixItemView: likeMix"); app = require('app'); app.vent.trigger("mix:like", this.model); @@ -146,7 +144,6 @@ MixItemView.prototype.mixShare = function(e) { var app, mode; - console.log("MixItemView: shareMix"); mode = $(e.currentTarget).data("mode"); console.log("MixItemView: " + mode); diff --git a/static/js/app/views/mix/mixListView.js b/static/js/app/views/mix/mixListView.js index 2bc1d4c..73ced97 100644 --- a/static/js/app/views/mix/mixListView.js +++ b/static/js/app/views/mix/mixListView.js @@ -1,19 +1,17 @@ -// Generated by CoffeeScript 1.6.2 +// Generated by CoffeeScript 1.3.3 (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; define(['marionette', 'vent', 'models/mix/mixCollection', 'views/mix/mixItemView', 'text!/tpl/MixListView'], function(Marionette, vent, MixCollection, MixItemView, Template) { - var MixListView, _ref; - + var MixListView; MixListView = (function(_super) { var currentMix; __extends(MixListView, _super); function MixListView() { - _ref = MixListView.__super__.constructor.apply(this, arguments); - return _ref; + return MixListView.__super__.constructor.apply(this, arguments); } MixListView.prototype.template = _.template(Template); @@ -28,7 +26,6 @@ MixListView.prototype.initialize = function() { var _this = this; - console.log("MixListView: initialize"); this.collection = new MixCollection(); this.collection.fetch({ @@ -45,6 +42,7 @@ MixListView.prototype.mixPlay = function(model) { console.log("MixListView: mixPlay"); "if currentMix != -1\n v = @children.findByModelCid(currentMix)\n v.mixPause()"; + currentMix = model.cid; }; diff --git a/static/js/app/views/sidebar/sidebarView.js b/static/js/app/views/sidebar/sidebarView.js index 0aa6aa6..1c76f73 100644 --- a/static/js/app/views/sidebar/sidebarView.js +++ b/static/js/app/views/sidebar/sidebarView.js @@ -1,17 +1,16 @@ -// Generated by CoffeeScript 1.6.2 +// Generated by CoffeeScript 1.3.3 (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; define(['underscore', 'backbone', 'marionette', 'vent', 'views/activity/activityListView', 'views/widgets/nowPlayingView', 'text!/tpl/SidebarView'], function(_, Backbone, Marionette, vent, ActivityListView, NowPlayingView, Template) { - var SidebarView, _ref; - + var SidebarView; SidebarView = (function(_super) { + __extends(SidebarView, _super); function SidebarView() { - _ref = SidebarView.__super__.constructor.apply(this, arguments); - return _ref; + return SidebarView.__super__.constructor.apply(this, arguments); } SidebarView.prototype.template = _.template(Template); @@ -37,6 +36,7 @@ this.streamRegion.show(new ActivityListView()); $(this.topRegion.el).hide(); "@topRegion.show(\n new NowPlayingView(\n model: new Backbone.Model({\n item_url: \"fdskjfhdsk\", title: \"Argle bargle\", user_profile_url: \"/\", user_name: \"Foo Ferra\"\n })\n ))"; + }; SidebarView.prototype.mixInit = function(model) { diff --git a/static/js/app/views/widgets/nowPlayingView.js b/static/js/app/views/widgets/nowPlayingView.js index 53c0212..e4e8640 100644 --- a/static/js/app/views/widgets/nowPlayingView.js +++ b/static/js/app/views/widgets/nowPlayingView.js @@ -1,17 +1,16 @@ -// Generated by CoffeeScript 1.6.2 +// Generated by CoffeeScript 1.3.3 (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; define(['marionette', 'vent', 'text!/tpl/NowPlayingView'], function(Marionette, vent, Template) { - var NowPlayingView, _ref; - + var NowPlayingView; NowPlayingView = (function(_super) { + __extends(NowPlayingView, _super); function NowPlayingView() { - _ref = NowPlayingView.__super__.constructor.apply(this, arguments); - return _ref; + return NowPlayingView.__super__.constructor.apply(this, arguments); } NowPlayingView.prototype.template = _.template(Template);