Skip to content

Commit

Permalink
Fix find or create transcription (#1072)
Browse files Browse the repository at this point in the history
* Fix current time update

* fix find or create transcription

* update version
  • Loading branch information
an-lee authored Sep 15, 2024
1 parent 88a655c commit 182cb2c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion enjoy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"name": "enjoy",
"productName": "Enjoy",
"version": "0.5.1",
"version": "0.5.2-preview",
"description": "Enjoy desktop app",
"main": ".vite/build/main.js",
"types": "./src/types.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/context/media-shadow-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ export const MediaShadowProvider = ({

const subscriptions = [
wavesurfer.on("timeupdate", (time: number) =>
setCurrentTime(parseFloat(time.toFixed(2)))
setCurrentTime(Math.ceil(time * 100) / 100)
),
wavesurfer.on("decode", () => {
const peaks: Float32Array = wavesurfer
Expand Down
4 changes: 2 additions & 2 deletions enjoy/src/renderer/hooks/use-transcriptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ export const useTranscriptions = (media: AudioType | VideoType) => {
targetType: media.mediaType,
});

if (tr.result && !tr.result["timeline"]) {
if (!tr?.result?.timeline) {
tr.result = {
originalText: tr.result?.originalText,
};
}

const transcriptionOnline = await findTranscriptionOnline();
if (transcriptionOnline && !tr.result["timeline"]) {
if (transcriptionOnline && !tr?.result?.timeline) {
return EnjoyApp.transcriptions
.update(tr.id, {
state: "finished",
Expand Down

0 comments on commit 182cb2c

Please sign in to comment.