@@ -933,9 +933,10 @@ Template.manageSongs.events({
}
});
},
- "click .remove-song-button": function(e){
- var genre = $(e.target).data("genre") || $(e.target).parent().data("genre");
- Meteor.call("removeSongFromPlaylist", genre, this.mid);
+ "click .remove-song-button": function(){
+ console.log(this.mid);
+ console.log("TEST!");
+ Meteor.call("deleteSong", this.mid);
"click #play": function() {
var duration = Session.get("song").duration;
@@ -1081,6 +1081,13 @@ Meteor.methods({
throw new Meteor.Error(403, "Invalid permissions.");
+ deleteSong: function (mid) {
+ if (isModerator() && !isBanned()) {
+ Songs.remove({mid: mid})
+ } else {
+ throw new Meteor.Error(403, "Invalid permissions.");
+ }
+ },
addSongToPlaylist: function (songData) {
if (isModerator() && !isBanned()) {
var requiredProperties = ["_id", "mid", "id", "title", "artist", "duration", "skipDuration", "img", "likes", "dislikes", "requestedBy", "genres"];