diff --git a/app/client/templates/components/playlist-item.html b/app/client/templates/components/playlist-item.html
index 57888e7..cb1830b 100644
--- a/app/client/templates/components/playlist-item.html
+++ b/app/client/templates/components/playlist-item.html
@@ -7,7 +7,7 @@
thumb_down
{{/if}}
-
+
{{song.data.title}}
{{#if song.user}}
diff --git a/app/client/templates/components/playlist-item.js b/app/client/templates/components/playlist-item.js
index 30f4c7e..7473b85 100644
--- a/app/client/templates/components/playlist-item.js
+++ b/app/client/templates/components/playlist-item.js
@@ -6,6 +6,11 @@ Template.PlaylistItem.rendered = function() {
};
Template.PlaylistItem.helpers({
+ getImage(img) {
+ if (img) return img;
+ return '/album-default.jpg';
+ },
+
getLink() {
const id = _.get(this, 'song.id');
const link = _.get(this, 'song.data.link');
diff --git a/app/collections/radios/methods.js b/app/collections/radios/methods.js
index 891dc6d..6720f2b 100644
--- a/app/collections/radios/methods.js
+++ b/app/collections/radios/methods.js
@@ -31,6 +31,7 @@ if (Meteor.isClient) {
}
if (Meteor.isServer) {
+ const PLAYLIST_SONG_LIMIT = 300;
let Helpers = App.collectionHelpers.radio;
Meteor.methods({
@@ -146,7 +147,7 @@ if (Meteor.isServer) {
if (Helpers.isSongBlocked(radioId, song.id)) throw new Meteor.Error(500, 'This song is blocked');
if (Helpers.isUserBlocked(radioId, song.user)) throw new Meteor.Error(500, 'Sorry, you cannot add songs to this radio');
- if (radio.playlist.length >= 100) throw new Meteor.Error(500, 'Sorry, the playlist is full');
+ if (radio.playlist.length >= PLAYLIST_SONG_LIMIT) throw new Meteor.Error(500, 'Sorry, the playlist is full');
if (!Helpers.isOwner(radioId)) {
if (Helpers.hasUserReachedLimit(radio)) throw new Meteor.Error(500, 'You have reached your limit for this radio. Please try again later');
@@ -177,6 +178,7 @@ if (Meteor.isServer) {
let guestRadios = [];
let guestUsers = [];
let toDelete;
+ let toDeleteArr = [];
Radios.find({isGuest: true}).forEach(function(radio) {
guestRadios.push({id: radio._id, user: radio.users[0]});
@@ -190,8 +192,14 @@ if (Meteor.isServer) {
return guestUsers.indexOf(radio.user) !== -1;
});
+ _.map(toDelete, (item) => {
+ toDeleteArr.push(item.id);
+ });
+
+ //TODO: test this and clean up the toDeleteArr (pluck not working anymore)
+
if (!_.isEmpty(toDelete)) {
- Radios.remove({'_id': {'$in': _.pluck(toDelete, 'id')}});
+ Radios.remove({'_id': {'$in': toDeleteArr}});
}
},