From 8a90a70648a29c0a2ff961fe4e4f8998a36549ae Mon Sep 17 00:00:00 2001 From: sunfkny <30853461+sunfkny@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:17:57 +0800 Subject: [PATCH 01/30] Fix deleteFeeds --- registry/lib/components/feeds/del-feeds/check-in-item.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/lib/components/feeds/del-feeds/check-in-item.ts b/registry/lib/components/feeds/del-feeds/check-in-item.ts index aa06777df0..67b56c0ca4 100644 --- a/registry/lib/components/feeds/del-feeds/check-in-item.ts +++ b/registry/lib/components/feeds/del-feeds/check-in-item.ts @@ -131,4 +131,4 @@ const builtInItems: CheckInItem[] = [ }, ] -export const [checkInItems] = registerAndGetData('checkInCenter.items', builtInItems) +export const [checkInItems] = registerAndGetData('deleteFeeds.items', builtInItems) From 09afe495413eb8db6e9d1b2d19e08417141c0ebd Mon Sep 17 00:00:00 2001 From: sunfkny <30853461+sunfkny@users.noreply.github.com> Date: Thu, 24 Oct 2024 19:43:51 +0800 Subject: [PATCH 02/30] =?UTF-8?q?[=E7=BB=84=E4=BB=B6-=E7=A6=81=E6=AD=A2?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=8A=A8=E6=80=81=E8=AF=A6=E6=83=85]=20fix:?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E5=B8=A6=E5=9B=BE=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=BA=8C=E6=AC=A1=E8=BD=AC=E5=8F=91=E5=90=8E?= =?UTF-8?q?=EF=BC=8C`=E6=9F=A5=E7=9C=8B=E5=9B=BE=E7=89=87`=20=E5=A4=B1?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- registry/lib/components/feeds/disable-details/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/registry/lib/components/feeds/disable-details/index.ts b/registry/lib/components/feeds/disable-details/index.ts index cfc9e9a4be..c781c0a729 100644 --- a/registry/lib/components/feeds/disable-details/index.ts +++ b/registry/lib/components/feeds/disable-details/index.ts @@ -41,6 +41,7 @@ const entry = async () => { 'bili-rich-text-topic', 'bili-rich-text-module', 'bili-rich-text-link', + 'bili-rich-text-viewpic', ].some(className => target.classList.contains(className)) ) { return From cf950a81f7919f8a4889934978c0fbb8dcf79e4a Mon Sep 17 00:00:00 2001 From: WakelessSloth56 Date: Sun, 27 Oct 2024 10:03:20 +0800 Subject: [PATCH 03/30] fix: fix wasm plugin option muxWithMetadata --- registry/lib/plugins/video/download/wasm-output/Config.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/lib/plugins/video/download/wasm-output/Config.vue b/registry/lib/plugins/video/download/wasm-output/Config.vue index 0934be6e4f..09862e113b 100644 --- a/registry/lib/plugins/video/download/wasm-output/Config.vue +++ b/registry/lib/plugins/video/download/wasm-output/Config.vue @@ -33,7 +33,7 @@ export default Vue.extend({ }, methods: { saveOptions() { - options.muxWithMetadata = this.muxExtraAssets + options.muxWithMetadata = this.muxWithMetadata Object.assign(storedOptions, options) }, }, From cb7df01bdf3216d45ef1c85d54a129c6e0c67b93 Mon Sep 17 00:00:00 2001 From: WakelessSloth56 Date: Sun, 27 Oct 2024 10:41:38 +0800 Subject: [PATCH 04/30] feat: wasm plugin deleteFile message --- .../video/download/wasm-output/ffmpeg.ts | 21 +++++++++++++++++++ .../video/download/wasm-output/handler.ts | 13 +++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts b/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts index 5f991c0ba1..04d025239d 100644 --- a/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts +++ b/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts @@ -17,6 +17,7 @@ enum FFMessageType { EXEC = 'EXEC', WRITE_FILE = 'WRITE_FILE', READ_FILE = 'READ_FILE', + DELETE_FILE = 'DELETE_FILE', ERROR = 'ERROR', } @@ -38,6 +39,7 @@ export class FFmpeg { case FFMessageType.EXEC: case FFMessageType.WRITE_FILE: case FFMessageType.READ_FILE: + case FFMessageType.DELETE_FILE: this.#resolves[id](data) break case FFMessageType.ERROR: @@ -140,6 +142,20 @@ export class FFmpeg { undefined, signal, ) as Promise + + public deleteFile = (path: string, signal?: AbortSignal) => + this.#send( + { + type: FFMessageType.DELETE_FILE, + data: { path }, + }, + undefined, + signal, + ) as Promise + + public onProgress(callback: (event: ProgressEvent) => void): void { + this.#progressEventCallback = callback + } } // ========================================================================== // @@ -165,11 +181,16 @@ interface FFMessageReadFileData { encoding: string } +interface FFMessageDeleteFileData { + path: string +} + type FFMessageData = | FFMessageLoadConfig | FFMessageExecData | FFMessageWriteFileData | FFMessageReadFileData + | FFMessageDeleteFileData interface Message { type: string diff --git a/registry/lib/plugins/video/download/wasm-output/handler.ts b/registry/lib/plugins/video/download/wasm-output/handler.ts index 7d6842e1cf..256c2612e6 100644 --- a/registry/lib/plugins/video/download/wasm-output/handler.ts +++ b/registry/lib/plugins/video/download/wasm-output/handler.ts @@ -59,13 +59,13 @@ async function single( httpGet(audioUrl, progress(1, '正在下载音频流')), ]) - ffmpeg.writeFile('video', video) - ffmpeg.writeFile('audio', audio) + await ffmpeg.writeFile('video', video) + await ffmpeg.writeFile('audio', audio) const args = ['-i', 'video', '-i', 'audio'] if (ffmetadata) { - ffmpeg.writeFile('ffmetadata', new TextEncoder().encode(ffmetadata)) + await ffmpeg.writeFile('ffmetadata', new TextEncoder().encode(ffmetadata)) args.push('-i', 'ffmetadata', '-map_metadata', '2') if (!outputMkv) { args.push('-movflags', '+use_metadata_tags') @@ -87,6 +87,13 @@ async function single( toast.message = '完成!' toast.duration = 1000 + await Promise.all([ + ffmpeg.deleteFile('video'), + ffmpeg.deleteFile('audio'), + ffmpeg.deleteFile('output'), + ffmetadata ? ffmpeg.deleteFile('ffmetadata') : Promise.resolve(), + ]) + await DownloadPackage.single( name.replace(/.[^/.]+$/, `.${outputMkv ? 'mkv' : 'mp4'}`), outputBlob, From 30ec155fa8a37c23afe7bc8f5a0cb62aff615b6f Mon Sep 17 00:00:00 2001 From: WakelessSloth56 Date: Sun, 27 Oct 2024 10:42:22 +0800 Subject: [PATCH 05/30] feat: wasm plugin progress event --- .../plugins/video/download/wasm-output/ffmpeg.ts | 15 ++++++++++++++- .../plugins/video/download/wasm-output/handler.ts | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts b/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts index 04d025239d..f02e78d346 100644 --- a/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts +++ b/registry/lib/plugins/video/download/wasm-output/ffmpeg.ts @@ -19,6 +19,7 @@ enum FFMessageType { READ_FILE = 'READ_FILE', DELETE_FILE = 'DELETE_FILE', ERROR = 'ERROR', + PROGRESS = 'PROGRESS', } export class FFmpeg { @@ -26,6 +27,8 @@ export class FFmpeg { #resolves: Callbacks = {} #rejects: Callbacks = {} + #progressEventCallback: (event: ProgressEvent) => void + public loaded = false #registerHandlers = () => { @@ -42,6 +45,11 @@ export class FFmpeg { case FFMessageType.DELETE_FILE: this.#resolves[id](data) break + case FFMessageType.PROGRESS: + if (this.#progressEventCallback) { + this.#progressEventCallback(data) + } + break case FFMessageType.ERROR: this.#rejects[id](data) break @@ -197,7 +205,12 @@ interface Message { data?: FFMessageData } -type CallbackData = Uint8Array | string | boolean | Error | undefined +interface ProgressEvent { + progress: number + time: number +} + +type CallbackData = Uint8Array | string | boolean | Error | ProgressEvent | undefined interface Callbacks { [id: number | string]: (data: CallbackData) => void diff --git a/registry/lib/plugins/video/download/wasm-output/handler.ts b/registry/lib/plugins/video/download/wasm-output/handler.ts index 256c2612e6..4be359a0dd 100644 --- a/registry/lib/plugins/video/download/wasm-output/handler.ts +++ b/registry/lib/plugins/video/download/wasm-output/handler.ts @@ -2,6 +2,7 @@ import { DownloadPackage, PackageEntry } from '@/core/download' import { meta } from '@/core/meta' import { getComponentSettings } from '@/core/settings' import { Toast } from '@/core/toast' +import { formatPercent } from '@/core/utils/formatters' import { title as pluginTitle } from '.' import type { Options } from '../../../../components/video/download' import { DownloadVideoAction } from '../../../../components/video/download/types' @@ -76,7 +77,9 @@ async function single( console.debug('FFmpeg commandline args:', args.join(' ')) - toast.message = '混流中……' + ffmpeg.onProgress(event => { + toast.message = `混流中: ${formatPercent(event.progress)}` + }) await ffmpeg.exec(args) const output = await ffmpeg.readFile('output') From f26495c63bb5015d668b54f5cda4ba66133dcde0 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sun, 10 Nov 2024 14:03:04 +0800 Subject: [PATCH 06/30] Improve search and empty state (#4975, #4973) --- registry/lib/docs/index.ts | 1 + .../online-registry/OnlineRegistry.vue | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/registry/lib/docs/index.ts b/registry/lib/docs/index.ts index 37b60ce513..9b7d711730 100644 --- a/registry/lib/docs/index.ts +++ b/registry/lib/docs/index.ts @@ -19,6 +19,7 @@ export interface DocSourceItem { name: string displayName: string description?: string + descriptionText?: string fullAbsolutePath: string fullRelativePath: string owner?: string diff --git a/src/components/settings-panel/sub-pages/online-registry/OnlineRegistry.vue b/src/components/settings-panel/sub-pages/online-registry/OnlineRegistry.vue index f3251253d1..66a0b9606e 100644 --- a/src/components/settings-panel/sub-pages/online-registry/OnlineRegistry.vue +++ b/src/components/settings-panel/sub-pages/online-registry/OnlineRegistry.vue @@ -52,7 +52,7 @@
- +