DTP Base provides a scalable and secure Node.js application development harness ready for production service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
871 B

// 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 },
flags: {
fromGif: { type: Boolean, default: false, required: true },
},
media: {
bucket: { type: String, required: true },
key: { type: String, required: true },
metadata: { type: MediaMetadataSchema },
},
});
export default mongoose.model('Video', VideoSchema);