AI story writer enhancements, text to video and voice generation, subscription management, and more.

This commit is contained in:
ajaysi
2025-11-19 09:55:32 +05:30
parent bf7493c366
commit e96525347b
64 changed files with 10367 additions and 400 deletions

View File

@@ -1,9 +1,19 @@
import { aiApiClient } from "../api/client";
export async function fetchMediaBlobUrl(pathOrUrl: string): Promise<string> {
const rel = pathOrUrl.startsWith("/") ? pathOrUrl : `/${pathOrUrl}`;
const res = await aiApiClient.get(rel, { responseType: "blob" });
return URL.createObjectURL(res.data);
export async function fetchMediaBlobUrl(pathOrUrl: string): Promise<string | null> {
try {
const rel = pathOrUrl.startsWith("/") ? pathOrUrl : `/${pathOrUrl}`;
const res = await aiApiClient.get(rel, { responseType: "blob" });
return URL.createObjectURL(res.data);
} catch (err: any) {
// Gracefully handle 404s and other errors - file might not exist or was regenerated
if (err?.response?.status === 404) {
console.warn(`Media file not found (404): ${pathOrUrl}`);
return null;
}
// Re-throw other errors
throw err;
}
}