Add Discovery Videos feature
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
This commit is contained in:
1 parent
4d88747649
commit
eb3a12f6cb
41 files changed
+2163
-15
No files matched your search
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
@@ -0,0 +1,17 @@
|
||||
const { DataTypes } = require("sequelize");
|
||||
const sequelize = require("../config/database");
|
||||
|
||||
// Junction table linking discovery videos to library entries (many-to-many)
|
||||
const VideoEntry = sequelize.define(
|
||||
"VideoEntry",
|
||||
{
|
||||
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
|
||||
video_id: { type: DataTypes.INTEGER },
|
||||
entry_id: { type: DataTypes.INTEGER },
|
||||
},
|
||||
{
|
||||
tableName: "video_entries",
|
||||
},
|
||||
);
|
||||
|
||||
module.exports = VideoEntry;
|
||||
Reference in new issue
Block a user