playlist.js 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. import mongoose from "mongoose";
  2. export default {
  3. displayName: { type: String, min: 1, max: 64, trim: true, required: true },
  4. songs: [
  5. {
  6. _id: { type: mongoose.Schema.Types.ObjectId },
  7. mediaSource: { 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", "admin"], required: true },
  21. replacements: [
  22. {
  23. oldMediaSource: { type: String, required: true },
  24. newMediaSource: { type: String, required: true },
  25. replacedAt: { type: Date, required: true }
  26. }
  27. ],
  28. featured: { type: Boolean, default: false },
  29. documentVersion: { type: Number, default: 7, required: true }
  30. };