feat: 支持标记章节

This commit is contained in:
lanyeeee
2025-08-27 07:33:47 +08:00
parent 3a7e30b2cf
commit 91f8c6d50c
3 changed files with 21 additions and 1 deletions
@@ -67,6 +67,13 @@ const audioQualitySelectOptions: SelectBaseOption<PreferAudioQuality>[] = [
</template>
</n-tooltip>
<n-checkbox class="w-22" v-model:checked="store.config.download_json">json文件</n-checkbox>
<n-tooltip placement="top" trigger="hover">
<div>将章节信息嵌入mp4文件的元数据中</div>
<div>使视频在各类播放器中支持章节导航(例如进度条分段)</div>
<template #trigger>
<n-checkbox v-model:checked="store.config.embed_chapter">章节标记</n-checkbox>
</template>
</n-tooltip>
</div>
<n-tooltip placement="left" trigger="hover" class="w-20vw">
+12
View File
@@ -97,6 +97,7 @@ onMounted(async () => {
const videoTask = progressData.video_task
const audioTask = progressData.audio_task
const mergeTask = progressData.merge_task
const embedChapterTask = progressData.embed_chapter_task
const danmakuTask = progressData.danmaku_task
const subtitleTask = progressData.subtitle_task
const coverTask = progressData.cover_task
@@ -115,9 +116,20 @@ onMounted(async () => {
const completedChunks = progressData.audio_task.chunks.filter((chunk) => chunk.completed).length
progressData.percentage = (completedChunks / chunkCount) * 100
progressData.taskIndicator = `音频分片 ${completedChunks}/${chunkCount}`
} else if (
mergeTask.selected &&
!mergeTask.completed &&
embedChapterTask.selected &&
!embedChapterTask.completed
) {
progressData.percentage = 100
progressData.taskIndicator = '合并视频音频+嵌入章节元数据'
} else if (mergeTask.selected && !mergeTask.completed) {
progressData.percentage = 100
progressData.taskIndicator = '合并视频和音频'
} else if (embedChapterTask.selected && !embedChapterTask.completed) {
progressData.percentage = 100
progressData.taskIndicator = '嵌入章节元数据'
} else if (danmakuSelected && !danmakuTask.completed) {
progressData.percentage = 100
progressData.taskIndicator = '弹幕'
@@ -153,7 +153,7 @@ function handleSearchClick() {
P{{ p.part_order }} {{ p.part_title }}
</ColorfulTag>
<div class="mt-auto flex gap-1 flex-wrap" title="下载内容">
<div class="mt-auto flex gap-1 flex-wrap pt-2" title="下载内容">
<ColorfulTag v-if="p.video_task.selected" color="blue">
视频(编码:{{ p.video_task.codec_type }} 画质:{{ p.video_task.video_quality }})
</ColorfulTag>
@@ -171,6 +171,7 @@ function handleSearchClick() {
<ColorfulTag v-if="p.nfo_task.selected" color="amber">nfo元数据</ColorfulTag>
<ColorfulTag v-if="p.json_task.selected" color="amber">json元数据</ColorfulTag>
<ColorfulTag v-if="p.embed_chapter_task.selected" color="amber">章节信息</ColorfulTag>
</div>
</div>
</div>