Support multiple subtitle tracks

Adds multi-language subtitle storage, upload/removal, and player/admin UI support, plus fixes subtitle metadata updates during upload.
This commit is contained in:
Mathieu Moran
2026-01-25 02:01:08 -05:00
parent 891eb67e2d
commit 406a4f0bb3
6 changed files with 390 additions and 45 deletions
+8 -1
View File
@@ -24,7 +24,14 @@ const movieSchema = new mongoose.Schema({
// Optional low-quality server file (relative path under VIDEO_FILES_DIR, default public/video)
// Served when the player requests ?quality=low on /api/video/:movieId.
video_file_low: { type: String, required: false },
// Optional subtitles (server-hosted .vtt, streamed via /api/subtitles/:movieId)
// Optional subtitles (server-hosted .vtt, streamed via /api/subtitles/:movieId/:subtitleId)
subtitles: [{
file: { type: String, required: true },
lang: { type: String, required: false },
label: { type: String, required: false },
default: { type: Boolean, required: false, default: false },
}],
// Legacy single-subtitle fields (kept for backward compatibility)
subtitle_file: { type: String, required: false },
subtitle_lang: { type: String, required: false },
subtitle_label: { type: String, required: false },