Browse Source

fix: _id, verified and skipDuration attributes missing from playlist and/or station schemas

Run update all songs job to update db and redis data
Owen Diffey 3 years ago
parent
commit
9e62f495e4
2 changed files with 8 additions and 6 deletions
  1. 6 5
      backend/logic/db/schemas/playlist.js
  2. 2 1
      backend/logic/db/schemas/station.js

+ 6 - 5
backend/logic/db/schemas/playlist.js

@@ -4,13 +4,14 @@ export default {
 	displayName: { type: String, min: 2, max: 32, trim: true, required: true },
 	displayName: { type: String, min: 2, max: 32, trim: true, required: true },
 	songs: [
 	songs: [
 		{
 		{
-			_id: { type: mongoose.Schema.Types.ObjectId, required: false },
-			youtubeId: { type: String },
+			_id: { type: mongoose.Schema.Types.ObjectId, required: true },
+			youtubeId: { type: String, required: true },
 			title: { type: String },
 			title: { type: String },
+			artists: [{ type: String }],
 			duration: { type: Number },
 			duration: { type: Number },
-			thumbnail: { type: String, required: false },
-			artists: { type: Array, required: false },
-			status: { type: String }
+			skipDuration: { type: Number },
+			thumbnail: { type: String },
+			verified: { type: Boolean }
 		}
 		}
 	],
 	],
 	createdBy: { type: String, required: true },
 	createdBy: { type: String, required: true },

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

@@ -7,7 +7,7 @@ export default {
 	description: { type: String, minlength: 2, maxlength: 128, trim: true, required: true },
 	description: { type: String, minlength: 2, maxlength: 128, trim: true, required: true },
 	paused: { type: Boolean, default: false, required: true },
 	paused: { type: Boolean, default: false, required: true },
 	currentSong: {
 	currentSong: {
-		_id: { type: String },
+		_id: { type: mongoose.Schema.Types.ObjectId, required: true },
 		youtubeId: { type: String },
 		youtubeId: { type: String },
 		title: { type: String },
 		title: { type: String },
 		artists: [{ type: String }],
 		artists: [{ type: String }],
@@ -28,6 +28,7 @@ export default {
 	locked: { type: Boolean, default: false },
 	locked: { type: Boolean, default: false },
 	queue: [
 	queue: [
 		{
 		{
+			_id: { type: mongoose.Schema.Types.ObjectId, required: true },
 			youtubeId: { type: String, required: true },
 			youtubeId: { type: String, required: true },
 			title: { type: String },
 			title: { type: String },
 			artists: [{ type: String }],
 			artists: [{ type: String }],