|
@@ -16,7 +16,7 @@ module.exports = {
|
|
|
|
|
|
update: (session, id, song, cb) => {
|
|
|
//TODO Require admin/login
|
|
|
- db.models.song.findOneAndUpdate({ id: id }, song, { upsert: true }, (err, updatedSong) => {
|
|
|
+ db.models.song.findOneAndUpdate({ id }, song, { upsert: true }, (err, updatedSong) => {
|
|
|
if (err) throw err;
|
|
|
cb(updatedSong);
|
|
|
});
|
|
@@ -24,7 +24,7 @@ module.exports = {
|
|
|
|
|
|
remove: (session, id, cb) => {
|
|
|
//TODO Require admin/login
|
|
|
- db.models.song.find({ id: song.id }).remove().exec();
|
|
|
+ db.models.song.find({ id }).remove().exec();
|
|
|
},
|
|
|
|
|
|
add: (session, id, cb) => {
|
|
@@ -117,7 +117,7 @@ module.exports = {
|
|
|
}
|
|
|
if (hasArtist && newSong.title.indexOf(item.name) !== -1) {
|
|
|
newSong.duration = item.duration_ms / 1000;
|
|
|
- newSong.artists = item.map(function (artist) {
|
|
|
+ newSong.artists = item.map(artist => {
|
|
|
return artist.name;
|
|
|
});
|
|
|
newSong.title = item.name;
|