From 06f8d32169e6fb02c34425148b9b8f74d6162585 Mon Sep 17 00:00:00 2001 From: an-lee Date: Mon, 19 Feb 2024 11:01:52 +0800 Subject: [PATCH] Feat improve media player page (#320) * download transcription from api when transcribed * add friendly loading panel on audio page * add loading panel for video page * fix locale * remove ubuntu 20.04 for e2e test * do not auto upload recording --- .github/workflows/test-enjoy-app.yml | 1 - enjoy/package.json | 2 +- enjoy/src/i18n/en.json | 11 +- enjoy/src/i18n/zh-CN.json | 11 +- enjoy/src/main/db/models/audio.ts | 3 +- enjoy/src/main/db/models/recording.ts | 9 +- enjoy/src/main/db/models/transcription.ts | 11 +- enjoy/src/main/db/models/video.ts | 5 +- .../components/audios/audio-detail.tsx | 156 +++++++++++++++++- .../components/medias/media-player.tsx | 2 +- .../components/medias/media-transcription.tsx | 49 +----- .../components/posts/post-actions.tsx | 4 +- .../components/videos/ted-talks-segment.tsx | 5 - .../components/videos/video-detail.tsx | 152 ++++++++++++++++- enjoy/src/types/transcription.d.ts | 1 + 15 files changed, 347 insertions(+), 75 deletions(-) diff --git a/.github/workflows/test-enjoy-app.yml b/.github/workflows/test-enjoy-app.yml index d3b66100..8c03c858 100644 --- a/.github/workflows/test-enjoy-app.yml +++ b/.github/workflows/test-enjoy-app.yml @@ -23,7 +23,6 @@ jobs: macos-14, windows-2019, windows-latest, - ubuntu-20.04, ubuntu-latest, ] steps: diff --git a/enjoy/package.json b/enjoy/package.json index 06c0def1..9f81db6c 100644 --- a/enjoy/package.json +++ b/enjoy/package.json @@ -8,7 +8,7 @@ "types": "./src/types.d.ts", "scripts": { "predev": "yarn run download", - "dev": "rimraf .vite && yarn run download && WEB_API_URL=http://localhost:3000 SETTINGS_PATH=./tmp LIBRARY_PATH=./tmp electron-forge start", + "dev": "rimraf .vite && yarn run download && WEB_API_URL=http://localhost:3000 SETTINGS_PATH=${PWD}/enjoy/tmp LIBRARY_PATH=${PWD}/enjoy/tmp electron-forge start", "start": "rimraf .vite && yarn run download && electron-forge start", "package": "rimraf .vite && yarn run download && electron-forge package", "make": "rimraf .vite && yarn run download && electron-forge make", diff --git a/enjoy/src/i18n/en.json b/enjoy/src/i18n/en.json index aa659884..17bf6c48 100644 --- a/enjoy/src/i18n/en.json +++ b/enjoy/src/i18n/en.json @@ -450,5 +450,14 @@ "syncingRecordings": "Syncing {{count}} recordings", "failedToSyncRecordings": "Syncing recordings failed", "downloadUrlNotResolved": "Download URL not resolved", - "resolvingDownloadUrl": "Resolving download URL" + "resolvingDownloadUrl": "Resolving download URL", + "waveformIsDecoded": "Waveform is decoded", + "decodingWaveform": "Decoding waveform", + "transcribedSuccessfully": "Transcribed successfully", + "transcribing": "Transcribing", + "notTranscribedYet": "Not transcribed yet", + "preparingAudio": "Preparing audio", + "preparingVideo": "Preparing video", + "itMayTakeAWhileToPrepareForTheFirstLoad": "It may take a while to prepare for the first load. Please be patient.", + "loadingTranscription": "Loading transcription" } diff --git a/enjoy/src/i18n/zh-CN.json b/enjoy/src/i18n/zh-CN.json index 7f527429..19d0951f 100644 --- a/enjoy/src/i18n/zh-CN.json +++ b/enjoy/src/i18n/zh-CN.json @@ -449,5 +449,14 @@ "syncingRecordings": "{{count}} 条录音正在同步", "failedToSyncRecordings": "同步录音失败", "downloadUrlNotResolved": "无法解析下载地址", - "resolvingDownloadUrl": "正在解析下载地址" + "resolvingDownloadUrl": "正在解析下载地址", + "waveformIsDecoded": "波形已解码", + "decodingWaveform": "正在解码波形", + "transcribedSuccessfully": "语音转文本成功", + "transcribing": "正在语音转文本", + "notTranscribedYet": "尚未语音转文本", + "preparingAudio": "正在准备音频", + "preparingVideo": "正在准备视频", + "itMayTakeAWhileToPrepareForTheFirstLoad": "首次加载可能需要一些时间,请耐心等候", + "loadingTranscription": "正在加载语音文本" } diff --git a/enjoy/src/main/db/models/audio.ts b/enjoy/src/main/db/models/audio.ts index 5c15bf4f..3a5b63ea 100644 --- a/enjoy/src/main/db/models/audio.ts +++ b/enjoy/src/main/db/models/audio.ts @@ -174,7 +174,8 @@ export class Audio extends Model