Files
FileHost/app/types/file.ts
T
tianmo a64be50b73 feat: 完善媒体管理与备份迁移流程
- 视频上传生成缩略图并提供占位封面和失败原因展示
- 支持 HLS 按需重新封装 MP4,并限制临时文件生命周期与访问权限
- 完善视频、文件 API 文档、搜索、批量删除和单次转码质量参数
- 修复备份恢复与跨后端迁移遗漏缩略图、HLS 清单和分片的问题
- 将备份任务、归档和下载权限按用户隔离
- 增加仅清理当前用户数据的高危存储清空流程和二次文字确认
- 修复 S3 中文文件名元数据及 CLI 数据库连接问题
- 补充备份恢复、用户隔离、媒体资源和转码相关测试
2026-10-17 13:46:02 +08:00

61 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { ImageTag, UploadErrorItem } from './image'
export interface FileItem {
key: string
url: string
originalName: string
contentType: string
size: number
uploadedAt: string
markdown: string
/** 视频转码状态(仅视频有值) */
transcodeStatus?: 'none' | 'pending' | 'running' | 'done' | 'failed'
/** 转码进度 0–100 */
transcodeProgress?: number
/** 本视频使用的转码档位 */
transcodePreset?: string
/** 转码失败原因 */
transcodeError?: string
/** HLS 播放列表地址(转码完成后有值) */
hlsUrl?: string
/** HLS 播放列表在存储中的 key */
hlsKey?: string
/** 视频封面缩略图地址 */
thumbUrl?: string
/** 上传来源(来自活动日志) */
uploadSource?: 'web' | 'api'
/** 转码成功后源视频已删除,不再提供原文件下载 */
sourceDeleted?: boolean
/** 视频标签 */
tags?: ImageTag[]
/** 管理员列表可见:上传者信息 */
owner?: {
userId: number | null
username: string
}
/** 文件所在存储后端 */
storage?: {
id: string
name: string
type: 'local' | 's3' | 'telegram'
}
}
export interface FileListResponse {
items: FileItem[]
total: number
page: number
pageSize: number
totalPages: number
/** 文件床直链访问方式(后台可切换) */
accessMode: 'public' | 'token'
}
export interface FileUploadResponse {
success: boolean
items: FileItem[]
errors: UploadErrorItem[]
/** 直链访问方式,token 模式下复制链接需要附带令牌 */
accessMode: 'public' | 'token'
}