mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
fixed bug where tts demo on the landing page would get stuck in pending status
This commit is contained in:
1 parent
7fe87286c1
commit
4ad99ff7bb
2 files changed
+13
-20
No files matched your search
@@ -86,7 +86,8 @@ export default function useInferenceJobsPolling({
|
||||
}
|
||||
}, [initialized, keepAlive, user]);
|
||||
|
||||
if (debug) console.log("☠️ keepAlive", keepAlive, inferenceJobs, byCategory);
|
||||
if (debug)
|
||||
console.log("💀 keepAlive", { keepAlive, inferenceJobs, byCategory });
|
||||
|
||||
const updateCategoryMap = (
|
||||
categoryMap: CategoryMap,
|
||||
|
||||
+11
-19
@@ -16,10 +16,6 @@ import {
|
||||
import { Analytics } from "common/Analytics";
|
||||
import { BucketConfig } from "@storyteller/components/src/api/BucketConfig";
|
||||
import DemoTtsAudioPlayer from "./DemoAudioPlayer";
|
||||
import {
|
||||
GetTtsInferenceJobStatus,
|
||||
GetTtsInferenceJobStatusIsOk,
|
||||
} from "@storyteller/components/src/api/jobs/GetTtsInferenceJobStatus";
|
||||
import { RandomTexts, PlaceholderTexts } from "./RandomTexts";
|
||||
import "./LandingDemo.scss";
|
||||
import { isMobile } from "react-device-detect";
|
||||
@@ -142,29 +138,25 @@ export default function LandingDemo({
|
||||
if (!jobToken) return;
|
||||
|
||||
const fetch = async () => {
|
||||
const jobStatusResponse = await GetTtsInferenceJobStatus(jobToken);
|
||||
const job = inferenceJobs.find(
|
||||
(job: InferenceJob) => job.jobToken === jobToken
|
||||
);
|
||||
|
||||
if (GetTtsInferenceJobStatusIsOk(jobStatusResponse)) {
|
||||
const job = inferenceJobs.find(
|
||||
(job: InferenceJob) => job.jobToken === jobToken
|
||||
if (job && job.maybeResultPublicBucketMediaPath) {
|
||||
const audioLink = new BucketConfig().getGcsUrl(
|
||||
job.maybeResultPublicBucketMediaPath
|
||||
);
|
||||
if (job && jobStatusResponse.state.maybe_public_bucket_wav_audio_path) {
|
||||
const audioLink = new BucketConfig().getGcsUrl(
|
||||
jobStatusResponse.state.maybe_public_bucket_wav_audio_path
|
||||
);
|
||||
setCurrentAudioUrl(audioLink);
|
||||
setCurrentAudioUrl(audioLink);
|
||||
|
||||
if (audioLink !== currentAudioUrl) {
|
||||
setIsAudioLoading(false);
|
||||
setIsPlaying(true);
|
||||
}
|
||||
if (audioLink !== currentAudioUrl) {
|
||||
setIsAudioLoading(false);
|
||||
setIsPlaying(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
fetch();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [jobToken, inferenceJobs, isPlaying]);
|
||||
}, [currentAudioUrl, jobToken, inferenceJobs]);
|
||||
|
||||
const handleAudioFinish = () => {
|
||||
setIsPlaying(false);
|
||||
|
||||
Reference in new issue
Block a user