feat: 完善媒体管理与备份迁移流程

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

No files matched your search

+16 -22
View File
@@ -16,11 +16,13 @@ const props = defineProps<{
const emit = defineEmits<{
'play': []
'delete': []
'download': []
'update:selected': [value: boolean]
}>()
const { formatFileSize } = useFileSize()
const { t, locale } = useI18n()
const transcodeFailureLabel = useTranscodeFailureLabel()
/** 转码完成后按 HLS 播放列表展示 */
const displayName = computed(() => {
@@ -37,34 +39,15 @@ const uploadedLabel = computed(() => {
return props.item.uploadedAt
}
})
const thumbFailed = ref(false)
watch(() => props.item.thumbUrl, () => {
thumbFailed.value = false
})
</script>
<template>
<div class="flex flex-col overflow-hidden rounded-xl border border-default bg-elevated">
<div class="relative aspect-video shrink-0 overflow-hidden bg-muted">
<img
v-if="item.thumbUrl && !thumbFailed"
<VideoThumbnail
:src="thumbLink"
:alt="displayName"
loading="lazy"
class="size-full object-cover object-center"
@error="thumbFailed = true"
>
<div
v-else
class="flex size-full items-center justify-center"
>
<UIcon
name="i-lucide-film"
class="size-10 text-dimmed"
/>
</div>
/>
<button
type="button"
@@ -108,8 +91,10 @@ watch(() => props.item.thumbUrl, () => {
color="error"
variant="solid"
size="xs"
class="max-w-48 truncate"
:title="transcodeFailureLabel(item.transcodeError)"
>
{{ t('library.transcodeFailed') }}
{{ transcodeFailureLabel(item.transcodeError) }}
</UBadge>
</div>
</div>
@@ -162,6 +147,15 @@ watch(() => props.item.thumbUrl, () => {
rel="noopener"
:aria-label="t('files.download')"
/>
<UButton
v-else-if="item.hlsUrl"
icon="i-lucide-download"
variant="ghost"
color="neutral"
size="sm"
:aria-label="t('library.video.downloadMp4')"
@click="emit('download')"
/>
<UButton
icon="i-lucide-trash-2"
variant="ghost"