feat: vod display (#686)

* feat: preview for html5 supported videos

* fix: handle out of limit tags

* feat: support preview on the donwload screen

* refactor: rework meta and preview handling to be more general

* fix: missing meta

* fix: do not allow maybe or probably types

* fix: make the media check more strict

---------

Co-authored-by: Levente Kiss <levente.kiss@solarpunk.bzz>
This commit is contained in:
Levente Kiss
2025-02-12 11:35:46 +01:00
committed by GitHub
parent f695ac3a1c
commit bcd3d50b42
12 changed files with 170 additions and 93 deletions
+7 -2
View File
@@ -1,3 +1,6 @@
import { isSupportedImageType } from './image'
import { isSupportedVideoType } from './video'
const indexHtmls = ['index.html', 'index.htm']
interface DetectedIndex {
@@ -83,12 +86,14 @@ export function getAssetNameFromFiles(files: FilePath[]): string {
export function getMetadata(files: FilePath[]): Metadata {
const size = files.reduce((total, item) => total + item.size, 0)
const isWebsite = Boolean(detectIndexHtml(files))
const name = getAssetNameFromFiles(files)
const type = files.length === 1 ? files[0].type : 'folder'
const count = files.length
const isWebsite = Boolean(detectIndexHtml(files))
const isVideo = isSupportedVideoType(type)
const isImage = isSupportedImageType(type)
return { size, name, type, isWebsite, count }
return { size, name, type, isWebsite, count, isVideo, isImage }
}
export function getPath(file: FilePath): string {