|
@@ -318,14 +318,14 @@ Template.room.events({
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
parts = location.href.split('/');
|
|
parts = location.href.split('/');
|
|
var roomType = parts.pop();
|
|
var roomType = parts.pop();
|
|
- var genre = id.toLowerCase();
|
|
|
|
|
|
+ var genre = roomType.toLowerCase();
|
|
var type = $("#type").val();
|
|
var type = $("#type").val();
|
|
id = $("#id").val();
|
|
id = $("#id").val();
|
|
var title = $("#title").val();
|
|
var title = $("#title").val();
|
|
var artist = $("#artist").val();
|
|
var artist = $("#artist").val();
|
|
var img = $("#img").val();
|
|
var img = $("#img").val();
|
|
var songData = {type: type, id: id, title: title, artist: artist, img: img};
|
|
var songData = {type: type, id: id, title: title, artist: artist, img: img};
|
|
- if(Playlists.find({type: roomType, "songs.title": songData.title}, {songs: {$elemMatch: {title: songData.title}}}).count() !== 0) {
|
|
|
|
|
|
+ if(Playlists.find({type: genre, "songs.title": songData.title}, {songs: {$elemMatch: {title: songData.title}}}).count() !== 0) {
|
|
$(".landing").prepend("<div class='alert alert-danger alert-dismissible' role='alert' style='margin-bottom: 0'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'><i class='fa fa-times'></i></span></button><strong>Song not added.</strong> This song is already is in the playlist.</div>");
|
|
$(".landing").prepend("<div class='alert alert-danger alert-dismissible' role='alert' style='margin-bottom: 0'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'><i class='fa fa-times'></i></span></button><strong>Song not added.</strong> This song is already is in the playlist.</div>");
|
|
} else{
|
|
} else{
|
|
Meteor.call("addSongToQueue", genre, songData, function(err, res) {
|
|
Meteor.call("addSongToQueue", genre, songData, function(err, res) {
|