Refactor: Add flexible video source options to Movie model

Co-authored-by: mathieumoran1 <[email protected]>
This commit is contained in:
Cursor Agent
2025-12-21 00:26:34 +00:00
co-authored by mathieumoran1
parent ae1f065000
commit 43925c3b60
5 changed files with 167 additions and 13 deletions
+8 -1
View File
@@ -9,7 +9,14 @@ const movieSchema = new mongoose.Schema({
// Oscar pool year / edition (used to segment movies + stats)
year: { type: Number, required: false, index: true },
category: { type: String, required: true },
vod_link: { type: String, required: true },
// Legacy "one field" player source.
// Kept for backwards-compat. New UI prefers video_src / embed_src.
vod_link: { type: String, required: false },
// Player configuration (optional; used by player.html)
player_mode: { type: String, required: false, enum: ["auto", "video", "embed"], default: "auto" },
video_src: { type: String, required: false }, // direct video file URL or HLS (.m3u8)
embed_src: { type: String, required: false }, // URL or iframe code
watchedBy: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }]
}, { timestamps: true });