playlist.js 844 B

1234567891011121314151617181920212223
  1. import mongoose from "mongoose";
  2. export default {
  3. displayName: { type: String, min: 2, max: 32, trim: true, required: true },
  4. songs: [
  5. {
  6. _id: { type: mongoose.Schema.Types.ObjectId, required: true },
  7. youtubeId: { type: String, required: true },
  8. title: { type: String },
  9. artists: [{ type: String }],
  10. duration: { type: Number },
  11. skipDuration: { type: Number },
  12. thumbnail: { type: String },
  13. verified: { type: Boolean }
  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", "user-liked", "user-disliked", "genre", "station"], required: true },
  21. documentVersion: { type: Number, default: 6, required: true }
  22. };