Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lharries committed May 8, 2024
1 parent 28f64e9 commit c16d451
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/dubbing/e2e-example/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def project_detail(id: str):
project.target_languages = new_meta["target_languages"]

if project.status == "failed":
raise Exception("Dubbing failed")
return make_response(jsonify(project))

for target_lang in project.target_languages:
download_dub(project.id, project.dubbing_id, target_lang)
Expand Down
10 changes: 8 additions & 2 deletions examples/dubbing/e2e-example/frontend/src/pages/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,14 @@ export const Create = () => {
)}
/>
<div className="flex mt-8">
<Button type="submit" size={"lg"} disabled={mutation.isLoading}>
Submit
<Button
type="submit"
size={"lg"}
disabled={
mutation.isLoading || !file || !form.watch("targetLang")
}
>
{mutation.isLoading ? "Loading..." : "Submit"}
</Button>
</div>
</div>
Expand Down
13 changes: 8 additions & 5 deletions examples/dubbing/e2e-example/frontend/src/pages/stream.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Stream = () => {
const { data } = useQuery({
queryKey: ["projects", params.id],
queryFn: () => getProject(params.id!),
refetchInterval: shouldRefetch ? 15000 : false, // refetch every 15 seconds
refetchInterval: shouldRefetch ? 2000 : false, // refetch every 15 seconds
});

useEffect(() => {
Expand All @@ -35,9 +35,12 @@ export const Stream = () => {
<Layout>
{data && data.status === "dubbing" && (
<div>
<p className="text-center">
Video still processing. Please refresh in a few seconds.
</p>
<p className="text-center">Video still processing. Please wait.</p>
</div>
)}
{data && data.status === "failed" && (
<div>
<p className="text-center">Video dubbing failed</p>
</div>
)}
{data && data.status === "dubbed" && (
Expand All @@ -52,7 +55,7 @@ export const Stream = () => {
url={getStreamUrl(data.id, selectedDub)}
controls
width={"100%"}
height={"100%"}
height={"400px"}
onProgress={progress => {
setPlayedSeconds(progress.playedSeconds);
}}
Expand Down

0 comments on commit c16d451

Please sign in to comment.