Let users upload videos, tag them with one or more entries, and watch them from a new Discovery Videos page. Backend: - Add Video and VideoEntry models and relations - Add video controller and /video routes - Add video thumbnail generation service (ffmpeg-static) - Add video upload storage location and config Frontend: - Add DiscoveryVideosPage with sidebar link and route - Add AddVideoDialog, VideoDropzone, EntryMultiSelect, VideoCard and VideoPlayerDialog components - Add discoveryVideos API client and useDiscoveryVideos hook - Add format helpers, video types and normalizers - Add skeleton for the page Docs: - Document the feature in docs-vault
24 lines
729 B
JavaScript
24 lines
729 B
JavaScript
const { DataTypes } = require("sequelize");
|
|
const sequelize = require("../config/database");
|
|
|
|
const Video = sequelize.define("video", {
|
|
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
|
|
|
title: { type: DataTypes.STRING(500) },
|
|
description: { type: DataTypes.TEXT, allowNull: true },
|
|
|
|
filename: { type: DataTypes.STRING(200) },
|
|
original_name: { type: DataTypes.STRING(500), field: "original_name" },
|
|
mime_type: { type: DataTypes.STRING(100), field: "mime_type" },
|
|
size: { type: DataTypes.BIGINT },
|
|
|
|
duration: { type: DataTypes.INTEGER, allowNull: true },
|
|
thumbnail_path: {
|
|
type: DataTypes.STRING(200),
|
|
field: "thumbnail_path",
|
|
allowNull: true,
|
|
},
|
|
});
|
|
|
|
module.exports = Video;
|