playlist.js 879 B

123456789101112131415161718192021222324
  1. import mongoose from "mongoose";
  2. export default {
  3. displayName: { type: String, min: 2, max: 32, required: true },
  4. isUserModifiable: { type: Boolean, default: true, required: true },
  5. songs: [
  6. {
  7. _id: { type: mongoose.Schema.Types.ObjectId, required: false },
  8. youtubeId: { type: String },
  9. title: { type: String },
  10. duration: { type: Number },
  11. thumbnail: { type: String, required: false },
  12. artists: { type: Array, required: false },
  13. status: { type: String },
  14. position: { type: Number }
  15. }
  16. ],
  17. createdBy: { type: String, required: true },
  18. createdAt: { type: Date, default: Date.now, required: true },
  19. createdFor: { type: String },
  20. privacy: { type: String, enum: ["public", "private"], default: "private" },
  21. type: { type: String, enum: ["user", "genre", "station"], required: true },
  22. documentVersion: { type: Number, default: 3, required: true }
  23. };