playlist.js 848 B

1234567891011121314151617181920212223
  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. }
  15. ],
  16. createdBy: { type: String, required: true },
  17. createdAt: { type: Date, default: Date.now, required: true },
  18. createdFor: { type: String },
  19. privacy: { type: String, enum: ["public", "private"], default: "private" },
  20. type: { type: String, enum: ["user", "genre", "station"], required: true },
  21. documentVersion: { type: Number, default: 4, required: true }
  22. };