AI Image and Audio Generation Improvements.

AI Video Generation Pre-Flight Checklist. Cost Estimate Improvements.
This commit is contained in:
ajaysi
2025-12-25 16:26:08 +05:30
parent 59913bffa9
commit 7512933c65
163 changed files with 8938 additions and 37401 deletions

View File

@@ -9,7 +9,9 @@ export const setMediaAuthTokenGetter = (getter: (() => Promise<string | null>) |
export async function fetchMediaBlobUrl(pathOrUrl: string): Promise<string | null> {
try {
const rel = pathOrUrl.startsWith("/") ? pathOrUrl : `/${pathOrUrl}`;
// If full URL (http/https), use as-is; otherwise ensure leading slash
const isAbsolute = /^https?:\/\//i.test(pathOrUrl);
const rel = isAbsolute ? pathOrUrl : pathOrUrl.startsWith("/") ? pathOrUrl : `/${pathOrUrl}`;
// Try to get token and add as query parameter as fallback for endpoints that support it
// This helps with endpoints that use get_current_user_with_query_token