station.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const mongoose = require('mongoose');
  2. module.exports = {
  3. name: { type: String, lowercase: true, maxlength: 16, minlength: 2, index: true, unique: true, required: true },
  4. type: { type: String, enum: ["official", "community"], required: true },
  5. displayName: { type: String, minlength: 2, maxlength: 32, required: true, unique: true },
  6. description: { type: String, minlength: 2, maxlength: 128, required: true },
  7. paused: { type: Boolean, default: false, required: true },
  8. currentSong: {
  9. songId: { type: String },
  10. title: { type: String },
  11. artists: [{ type: String }],
  12. duration: { type: Number },
  13. skipDuration: { type: Number },
  14. thumbnail: { type: String },
  15. likes: { type: Number, default: -1 },
  16. dislikes: { type: Number, default: -1 },
  17. skipVotes: [{ type: String }],
  18. },
  19. currentSongIndex: { type: Number, default: 0, required: true },
  20. timePaused: { type: Number, default: 0, required: true },
  21. pausedAt: { type: Number, default: 0, required: true },
  22. startedAt: { type: Number, default: 0, required: true },
  23. playlist: { type: Array },
  24. genres: [{ type: String }],
  25. blacklistedGenres: [{ type: String }],
  26. privacy: { type: String, enum: ["public", "unlisted", "private"], default: "private" },
  27. locked: { type: Boolean, default: false },
  28. queue: [{
  29. songId: { type: String, required: true },
  30. title: { type: String },
  31. artists: [{ type: String }],
  32. duration: { type: Number },
  33. skipDuration: { type: Number },
  34. thumbnail: { type: String },
  35. likes: { type: Number, default: -1 },
  36. dislikes: { type: Number, default: -1 },
  37. requestedBy: { type: String, required: true }
  38. }],
  39. owner: { type: String },
  40. privatePlaylist: { type: mongoose.Schema.Types.ObjectId },
  41. partyMode: { type: Boolean }
  42. };