// video.js // Copyright (C) 2024 DTP Technologies, LLC // All Rights Reserved 'use strict'; import mongoose from 'mongoose'; const Schema = mongoose.Schema; import { VIDEO_STATUS_LIST, MediaMetadataSchema, } from './lib/media.js'; const VideoSchema = new Schema({ created: { type: Date, default: Date.now, required: true, index: -1 }, owner: { type: Schema.ObjectId, required: true, index: 1, ref: 'User' }, duration: { type: Number }, thumbnail: { type: Schema.ObjectId, ref: 'Image' }, status: { type: String, enum: VIDEO_STATUS_LIST, required: true, index: 1 }, media: { bucket: { type: String, required: true }, key: { type: String, required: true }, metadata: { type: MediaMetadataSchema }, }, }); export default mongoose.model('Video', VideoSchema);