Browse Source

Added explicit property to queueSongs.

Kris 8 years ago
parent
commit
012a770424
2 changed files with 4 additions and 1 deletions
  1. 3 1
      backend/logic/actions/queueSongs.js
  2. 1 0
      backend/logic/db/schemas/queueSong.js

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

@@ -20,7 +20,7 @@ module.exports = {
 		db.models.queueSong.findOne({ id }, function(err, queueSong) {
 			if (err) throw err;
 			//List of properties that are allowed to be changed
-			const updatableProperties = ["id", "title", "artists", "genres", "thumbnail", "duration", "skipDuration"];
+			const updatableProperties = ["id", "title", "artists", "genres", "thumbnail", "explicit", "duration", "skipDuration"];
 			//TODO Check if new id, if any, is already in use in queue or on rotation
 			let updated = false;
 			for (let prop in queueSong) {
@@ -99,6 +99,7 @@ module.exports = {
 						duration: durInSec,
 						skipDuration: 0,
 						thumbnail: '',
+						explicit: false,
 						requestedBy: '',
 						requestedAt: requestedAt
 					};
@@ -139,6 +140,7 @@ module.exports = {
 									return artist.name;
 								});
 								newSong.title = item.name;
+								newSong.explicit = item.explicit;
 								break durationArtistLoop;
 							}
 						}

+ 1 - 0
backend/logic/db/schemas/queueSong.js

@@ -6,6 +6,7 @@ module.exports = {
 	duration: { type: Number, required: true },
 	skipDuration: { type: Number, required: true },
 	thumbnail: { type: String, required: true },
+	explicit: { type: Boolean, required: true },
 	requestedBy: { type: String, required: true },
 	requestedAt: { type: Date, required: true }
 };