Browse Source

Minor fixes to Kris's commit

theflametrooper 8 years ago
parent
commit
0309c2b429
2 changed files with 5 additions and 5 deletions
  1. 3 3
      backend/logic/actions/queueSongs.js
  2. 2 2
      backend/logic/actions/songs.js

+ 3 - 3
backend/logic/actions/queueSongs.js

@@ -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;

+ 2 - 2
backend/logic/actions/songs.js

@@ -13,7 +13,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);
 		});
@@ -21,7 +21,7 @@ module.exports = {
 
 	remove: (session, id, cb) => {
 		//TODO Require admin/login
-		db.models.song.find({ id: id }).remove().exec();
+		db.models.song.find({ id }).remove().exec();
 	},
 
 	add: (session, id, cb) => {