Browse Source

Worked on replacing playlist _id.

KrisVos130 8 years ago
parent
commit
ace32436b2

+ 0 - 1
backend/logic/actions/playlists.js

@@ -148,7 +148,6 @@ let lib = {
 			(next) => {
 				const { displayName, songs } = data;
 				db.models.playlist.create({
-					_id: utils.generateRandomString(17),//TODO Check if exists
 					displayName,
 					songs,
 					createdBy: userId,

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

@@ -1,5 +1,4 @@
 module.exports = {
-	_id: { type: String, min: 17, max: 17, unique: true, index: true, required: true },
 	displayName: { type: String, min: 2, max: 32, required: true },
 	songs: { type: Array },
 	createdBy: { type: String, required: true },

+ 3 - 1
backend/logic/db/schemas/station.js

@@ -1,3 +1,5 @@
+const mongoose = require('mongoose');
+
 module.exports = {
 	name: { type: String, lowercase: true, maxlength: 16, minlength: 2, index: true, unique: true, required: true },
 	type: { type: String, enum: ["official", "community"], required: true },
@@ -36,6 +38,6 @@ module.exports = {
 		requestedBy: { type: String, required: true }
 	}],
 	owner: { type: String },
-	privatePlaylist: { type: String },
+	privatePlaylist: { type: mongoose.Schema.Types.ObjectId },
 	partyMode: { type: Boolean }
 };