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
@@ -10,7 +10,7 @@
|
||||
* - Genres come as string arrays from the backend mapper
|
||||
*/
|
||||
|
||||
import type { Entry, Collection, Media, Credit, Genre } from "@/types";
|
||||
import type { Entry, Collection, Media, Credit, Genre, DiscoveryVideo } from "@/types";
|
||||
|
||||
/* ---------- Media ---------- */
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -87,6 +87,25 @@ export function normalizeEntry(raw: any): Entry {
|
||||
};
|
||||
}
|
||||
|
||||
/* ---------- Discovery Video ---------- */
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function normalizeDiscoveryVideo(raw: any): DiscoveryVideo {
|
||||
return {
|
||||
id: raw.id,
|
||||
title: raw.title,
|
||||
description: raw.description ?? null,
|
||||
filename: raw.filename,
|
||||
original_name: raw.original_name ?? raw.originalName ?? "",
|
||||
mime_type: raw.mime_type ?? raw.mimeType ?? "",
|
||||
size: raw.size ?? 0,
|
||||
duration: raw.duration ?? null,
|
||||
thumbnail_path: raw.thumbnail_path ?? raw.thumbnailPath ?? null,
|
||||
createdAt: raw.createdAt,
|
||||
updatedAt: raw.updatedAt,
|
||||
entries: raw.entries ? raw.entries.map(normalizeEntry) : undefined,
|
||||
};
|
||||
}
|
||||
|
||||
/* ---------- Collection ---------- */
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function normalizeCollection(raw: any): Collection {
|
||||
|
||||
Reference in new issue
Block a user