Commit Graph

182 Commits

Author SHA1 Message Date
ajaysi
913e59a0a8 fix: voice clone preview audio authentication + MIME type fixes
- Restore auth on assets_serving.py using get_current_user_with_query_token
  (supports ?token= query param for <audio> elements)
- Add proper MIME type detection on asset serving (fixes NotSupportedError)
- Use storage_paths for path resolution in assets_serving.py
- VoiceSelector: append auth token to preview URLs for /api/ endpoints
- VoiceAvatarPlaceholder: add authenticatedAudioUrl state with async token
  resolution so <audio> elements get ?token= query param
- TestPersonaModal: same auth token pattern for voice preview audio
2026-04-22 08:04:55 +05:30
ajaysi
02d13716f3 fix: voice clone preview audio not playing + avatar upload 500 + asset serving
- Fix voice clone preview saved as .wav regardless of actual format (MP3/WebM
  content from WaveSpeed was saved with .wav extension causing NotSupportedError)
- Add detect_audio_format() and ensure_audio_extension() to media_utils
- Fix assets_serving.py: use storage_paths for root resolution, add proper
  MIME types to FileResponse, add auth via query token for <audio> elements
- Fix assets_serving.py: add path traversal security check
- Fix step4_asset_routes.py: use get_user_workspace() instead of WORKSPACE_DIR,
  detect actual audio format before saving preview
- Fix get_db() in database.py: raise HTTPException(401) instead of raw Exception,
  catch engine creation failures with HTTPException(503)
- Fix avatar.py: add auth error handling, diagnostic logging for path resolution,
  graceful DB save degradation
2026-04-22 07:24:28 +05:30
ajaysi
c5d625945f fix: centralize ROOT_DIR resolution, fix workspace path on Render.com, cleanup legacy paths
- Upgrade utils/storage_paths.py with robust find_repo_root() (env var override + validation + fallback)
- Remove broken _find_root() from podcast/constants.py, import from storage_paths instead
- Fix ROOT_DIR resolving to backend/ instead of project root (caused avatar upload 500s on Render.com)
- Fix video_combination_service.py default output dir (was writing to data/media instead of workspace)
- Add deprecation comments to global data/media constants in media_utils.py
- Pass user_id through resolve_media_path for tenant-scoped podcast resolution
- Add ALWRITY_ROOT_DIR env var support for explicit production overrides
- Log warning when get_podcast_media_dir called without user_id
- Use OperationButton with cost display for scene action buttons
2026-04-22 06:28:45 +05:30
ajaysi
b1ca29f7f7 fix: workspace-aware media resolution + production-ready logging
- load_podcast_image_bytes now accepts user_id for workspace-aware resolution
- Video and avatar handlers pass user_id to image loading
- Strip JWT tokens from console logs (dev-only verbose logging)
- Guard debug logs behind NODE_ENV===development in SceneCard, useRenderQueue, SubscriptionContext, mediaCache
- Add devLogger utility
2026-04-21 21:19:40 +05:30
ajaysi
91b2f996fd feat: voice clone audio generation + podcast workspace architecture
- Voice clone integration: When user selects voice clone in Write phase,
  backend uses their uploaded voice sample + scene script text to generate
  audio via qwen3/minimax/cosyvoice voice clone APIs
- Multi-tenant workspace storage: All podcast assets (audio, video, images,
  charts) now use workspace-specific directories per user
- Chart preview improvements: Card-based B-Roll charts UI with thumbnails,
  takeaway text, and action buttons; public endpoint for image serving
- Voice clone caching: In-memory LRU cache for voice samples (avoids
  re-downloading per scene); frontend caches voice clone metadata
- Thread pool for voice clone: Audio generation uses ThreadPoolExecutor to
  avoid blocking the FastAPI event loop
- Auto-detect voice clone IDs (vc_*, MY_VOICE_CLONE) to route correctly
- DB fallback for voice sample URL: Fetches from ContentAsset if not passed
- Fixed API URL resolution for chart previews
- Fixed GlassyCard DOM warnings for motion props
- Fixed ScriptGenerationProgressView syntax error
- Fixed usePodcastWorkflow scriptData reference
2026-04-21 19:38:50 +05:30
ajaysi
7637babd7d Add detailed logging for project update debugging 2026-04-20 16:01:13 +05:30
ajaysi
afdbc78779 Add detailed logging for voice clone debugging in production 2026-04-20 15:46:11 +05:30
ajaysi
4a4b8c5a24 Fix voice clone preview URL not matching saved file
The save_file_safely function may add a UUID suffix to the filename if there's
a collision, but the preview URL was being constructed using the original
filename instead of the actual saved filename. Now uses saved_preview_path.name.
2026-04-20 14:08:43 +05:30
ajaysi
625dd550d3 Fix production issues: add matplotlib dep, fix get_db calls, resolve ESLint
- Add matplotlib>=3.7.0 to requirements-podcast.txt (B-roll requires it)
- Fix research.py and exa_provider.py using get_session_for_user() instead of broken Depends(get_db)
- Fix BrollInfoPanel.tsx: call useScriptEditor hook unconditionally
- Add debug logging to avatar endpoint for troubleshooting
2026-04-20 12:55:25 +05:30
ajaysi
7f7279f903 Merge remote-tracking branch 'origin/codex/task-title-3y5pbt' 2026-04-20 08:47:19 +05:30
ي
e68c289901 Harden audio-only script flow and mode propagation 2026-04-20 08:44:46 +05:30
ajaysi
f748c081c2 Merge remote-tracking branch 'origin/codex/task-title' 2026-04-20 08:40:16 +05:30
ي
cf70261658 Implement async B-roll scene rendering with media path resolution 2026-04-20 08:32:42 +05:30
ajaysi
7aead3ae7d Merge remote-tracking branch 'origin/codex/refactor-preview-generation-flow' 2026-04-20 08:28:16 +05:30
ي
6db378beff Refactor chart preview IDs to use one deterministic identifier 2026-04-20 08:22:58 +05:30
ي
17c046c51e Add broll router to podcast API registrations 2026-04-20 08:19:55 +05:30
ajaysi
ba9ddbf368 Fix: Avatar/media path resolution and voice clone dependencies
- Remove nltk dependency from step4_assets by inlining _extract_user_id
- Add graceful error handling for step4_assets in podcast-only mode
- Fix media_utils.py to use tenant-aware get_podcast_media_read_dirs()
- Resolves avatar image 404 during scene image generation
2026-04-20 08:01:45 +05:30
ajaysi
bfa1b028b3 Fix: Upsert pattern for project update - create if not exists 2026-04-20 06:31:59 +05:30
ajaysi
0cac25751f Debug: Add logging for audio serve and project update endpoints 2026-04-20 06:27:54 +05:30
ي
95edd7d470 Add podcast research metadata mapping and summary sections 2026-04-19 16:51:51 +05:30
ajaysi
5f13ee5f7b Merge PR #473: Move podcast estimate calculation to backend pricing catalog 2026-04-19 16:30:38 +05:30
ي
e71cf65802 Move podcast cost estimates to backend pricing catalog 2026-04-19 16:23:00 +05:30
ي
196ea65af9 Add structured podcast research cost_est across backend/frontend 2026-04-19 16:13:46 +05:30
ajaysi
e704aa7d87 Podcast Maker: Fix progress modals, research JSON, header stepper, voice/podcastMode chips 2026-04-19 13:16:59 +05:30
ajaysi
e59c77b221 feat: Improve podcast maker UX and fix bugs
Frontend:
- Add progress modals with educational content for analysis and voice cloning
- Improve tab navigation in AnalysisPanel (combine Titles, Hook, CTA into one tab)
- Fix tab styling to make inactive tabs visible
- Fix avatar 'Make Presentable' not updating preview (blob URL handling)
- Improve mobile responsiveness for avatar tabs
- Clean up verbose console logging (AnalysisPanel, demoMode, RobustCamera)
- Add sequential progress messages instead of cycling

Backend:
- Fix 'Depends object has no attribute get' error in auth and image editing
- Use get_session_for_user instead of get_db outside FastAPI DI context
- Reduce WARNING logs to DEBUG in audio handler
- Add proper emphasis boolean handling in script generation
- Add missing fields to PodcastScene and PodcastSceneLine models
- Fix voice cloning cost estimate display issue
2026-04-07 16:28:11 +05:30
ajaysi
813f9acc34 Fix: Improve error handling for image editing when API keys are missing
- Fix database session handling in main_image_editing.py to use proper generator handling
- Add graceful handling of validation errors in podcast-only mode
- Add better error messages when WAVESPEED_API_KEY or HF_TOKEN is missing
- Add specific HTTP 503 error for configuration issues
- Add ALWRITY_SKIP_IMAGE_EDITING_VALIDATION env var to bypass validation in dev
2026-04-07 11:57:35 +05:30
ajaysi
60b6b0904b Add detailed logging to make-presentable endpoint for debugging 2026-04-07 11:54:37 +05:30
ajaysi
348839be36 Fix: Improve podcast analysis LLM prompt and skip bible generation in podcast mode
- Add pandas to requirements-podcast.txt for usage tracking
- Fix LLM prompt to return plain strings instead of objects for enhanced_ideas
- Add object-to-string normalization for LLM responses that return objects
- Skip bible generation in podcast-only mode (onboarding disabled)
- Skip alerts polling in AlertsBadge when in podcast-only demo mode
2026-04-06 15:19:23 +05:30
ajaysi
917be873df Fix: add missing deps, lazy-load heavy modules in podcast mode 2026-04-06 07:37:02 +05:30
ajaysi
63bb937796 feat: podcast demo mode with ALWRITY_ENABLED_FEATURES support
- Add ALWRITY_ENABLED_FEATURES env var for feature gating
- Podcast-only mode: skip LLM bootstrap, scheduler, persona services
- Enhance video generation prompt with scene context, analysis, narration
- Add voice cloning support via custom_voice_id in WaveSpeed
- Add text-to-speech for research results (browser speechSynthesis)
- Fix render queue to sync images from script phase
- Add WaveSpeed LLM pricing (gpt-oss-120b)
- Fix podcast bible generation error handling
- Refactor RouterManager for feature-based router loading
2026-04-03 06:59:59 +05:30
ajaysi
c52b1eabc9 Remove hardcoded huggingface provider from all podcast handlers
- script.py: set preferred_provider=None to respect GPT_PROVIDER
- research.py: set preferred_provider=None to respect GPT_PROVIDER
- Now all podcast handlers use GPT_PROVIDER env var
2026-04-01 06:55:31 +05:30
ajaysi
746a5eeeb9 Fix LLM provider selection in podcast handlers
- Remove hardcoded preferred_provider=huggingface in podcast handlers
- Set preferred_provider=None to respect GPT_PROVIDER env var
- Change default model from Qwen to gpt-oss-120b:cerebras (the model user had access to)
- WaveSpeed will now use gpt-oss-120b model instead of Qwen
2026-04-01 06:54:37 +05:30
ajaysi
35fd700b22 Propagate LLM errors in podcast handlers to frontend
- analysis.py: enhance_podcast_idea now re-raises HTTPException (429)
- analysis.py: analyze_podcast_idea already re-raises HTTPException
- research.py: re-raise HTTPException instead of silent fallback
- script.py: re-raise HTTPException instead of generic 500

Ensures 429 errors with usage_info reach frontend for modal display
2026-03-31 19:32:23 +05:30
ajaysi
92bcd27004 Fix generate_image() call in podcast analysis handler
Use options dict instead of direct width/height params to match
the generate_image() function signature in main_image_generation.py
2026-03-31 18:16:19 +05:30
ajaysi
92bbe1d878 Merge PR #456: Add forced user_id lint check and demo router gating 2026-03-30 08:18:50 +05:30
ي
636989f75b Add forced user_id lint check and demo router gating 2026-03-30 08:13:48 +05:30
ajaysi
2a41e94c07 Merge PR #454: Use tenant-scoped dubbed audio paths with safe file resolution 2026-03-30 08:07:39 +05:30
ي
27c167ebe8 Use tenant-scoped dubbed audio paths with safe file resolution 2026-03-30 08:07:01 +05:30
ي
b54c2978c3 Restrict podcast task status access by owner 2026-03-30 08:05:44 +05:30
ajaysi
557f700f68 fix: Resolve APIProvider enum mismatch causing dashboard errors
- Fix import path in subscriptions.py (pricing_service location)
- Add values_callable to APIUsageLog.provider enum column
- Normalize provider values to lowercase in usage trends helpers
- Add migration script for existing databases
2026-03-29 12:50:50 +05:30
ajaysi
d6ad903e3d feat: Improve image generation prompts with visual data extraction
- Add dedicated image_generation module with statistical extraction
- Support 16 industry domains with visual concept detection
- Add model-specific guidance for Ideogram, FLUX, GLM, Qwen, MAI
- Extract statistics, rankings, comparisons, and trends automatically
- Refactor backend/api/images.py to use new module
2026-03-29 10:16:40 +05:30
ajaysi
f503a24b3b feat: Add Auto-Dubbing feature for Podcast Maker
This commit adds the Auto-Dubbing feature for Podcast Maker with support
for translating podcast audio to different languages with optional voice
cloning to preserve the original speaker's voice.

New Features:
- Translation Service (common module): DeepL integration for low-cost
  translation, WaveSpeed integration for high-quality translation
- Audio Dubbing Service: STT -> Translate -> TTS pipeline with
  voice cloning support
- 9 new API endpoints for dubbing and voice cloning
- Support for 34+ languages
- Cost estimation utilities
- Comprehensive documentation

Files Added:
- services/translation/ (5 files): Translation service module
- services/dubbing/: Audio dubbing service
- api/podcast/handlers/dubbing.py: API endpoints
- docs/AUTO_DUBBING.md: Feature documentation
- CHANGELOG.md: Change log

Files Modified:
- api/podcast/models.py: Added dubbing request/response models
- api/podcast/router.py: Added dubbing routes
- services/__init__.py: Export translation and dubbing services
- scene_animation.py: Fixed missing Path import
2026-03-24 15:45:51 +05:30
ajaysi
16be2b21f4 Fix user data endpoints to require authenticated user ID
- Add get_current_user authentication to all user data endpoints
- Pass authenticated user_id from auth context to service methods
- Add proper HTTPException handling for missing data
- Fix user_id type from int to str in service methods
- Ensure endpoints only return data for authenticated user
2026-03-22 11:02:35 +05:30
ajaysi
acc5e1f72c Merge_PR_415_enforce_runtime_only_workspace_creation 2026-03-12 16:01:23 +05:30
ajaysi
e7171df5db Merge branch 'pr-413' 2026-03-12 15:46:43 +05:30
ajaysi
f23e99558f Merge branch 'pr-412' 2026-03-12 15:41:04 +05:30
ajaysi
d4bec3c791 Merge_PR_411_tenant_aware_video_studio_storage 2026-03-12 15:39:12 +05:30
ajaysi
d0267c7608 Merge branch 'pr-409' 2026-03-12 15:33:33 +05:30
ajaysi
901470eb8b Merge_PR_408_flat_context_and_txtai_file_tools 2026-03-12 15:29:08 +05:30
ajaysi
e90a29c27e Merge_PR_410_with_local_changes 2026-03-12 15:21:08 +05:30