feat: save modified subtitle

This commit is contained in:
2024-07-28 00:44:55 +08:00
parent d637442fda
commit c80940312d
7 changed files with 97 additions and 40 deletions

View File

@@ -37,9 +37,9 @@ defineShortcuts({
},
},
'meta_s': {
handler: () => {
handler: async () => {
if (isDropdownOpen.value && isDownloadable.value) {
startDownload(props.course.subtitle_url, `眩生花微课_${ props.course.title }_${ props.course.task_id }.srt`)
await startDownload(await fetchCourseSubtitleUrl(props.course), `眩生花微课_${ props.course.title }_${ props.course.task_id }.srt`)
}
},
},
@@ -220,7 +220,7 @@ const copyTaskId = (extraMessage?: string) => {
disabled: !isDownloadable,
click: () => isPreviewModalOpen = true,
}, {
label: '查看字幕',
label: '编辑字幕',
icon: 'i-solar-subtitles-linear',
shortcuts: [metaSymbol, 'D'],
disabled: !isDownloadable,
@@ -233,8 +233,8 @@ const copyTaskId = (extraMessage?: string) => {
icon: 'i-tabler-file-download',
shortcuts: [metaSymbol, 'S'],
disabled: !isDownloadable,
click: () => {
startDownload(course.subtitle_url, `眩生花微课_${ props.course.title }_${ props.course.task_id }.srt`)
click: async () => {
await startDownload(await fetchCourseSubtitleUrl(course), `眩生花微课_${ props.course.title }_${ props.course.task_id }.srt`)
}
}], [{
label: '删除记录',