Commit graph

7 commits

Author SHA1 Message Date
michael
a447994375 feat: Add per-pet-type prompt templates for song generation
Replace the generic song generation prompt with pet-specific prompt
templates. Each pet type (Dog, Cat, Fish, Bird, Hamster, Gerbil,
Guinea Pig, Rabbit, Bearded Dragon, Leopard Gecko, Corn Snake) now
has its own tailored prompt with pet-specific behaviors and content
restrictions.

Also fix typo: "Beared Dragon" → "Bearded Dragon" in schemas.py and
home.js. The prompts.py file includes backwards compatibility for the
old spelling to handle any pending database records.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 09:47:44 -06:00
michael
59357cff06 fix: Fetch Sonauto credits directly if cache is empty
The queue-status endpoint now fetches credits from the Sonauto API
when the Redis cache is empty/zero, making the admin dashboard
more reliable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 09:21:59 -06:00
michael
a570ac657f fix: Improve audio streaming reliability and playback
Stream endpoint:
- Increase read timeout to 600s for progressive audio generation
- Use larger 16KB chunks for smoother playback
- Remove misleading Accept-Ranges header (we don't support range requests)
- Add logging for stream start/completion
- Properly close httpx client after streaming

Frontend:
- Wait for 'canplay' event before attempting autoplay
- Add event listeners for play, error, stalled, waiting
- Native audio controls' play button now properly hides tap message
- Add 5s fallback timeout if canplay doesn't fire

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 08:40:02 -06:00
michael
a411f962f0 fix: Sync backend schema with frontend pet types and music vibes
Frontend was updated in 1b26b7a but backend validation wasn't updated,
causing 422 errors on form submission.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 08:29:42 -06:00
michael
9c5b054dcc feat: Add Sonauto streaming audio on waiting page
Enable users to listen to their song while video generation continues
in the background. Backend proxies authenticated Sonauto stream API
since HTML audio elements cannot send auth headers.

- Add streaming_ready_at column to track when stream becomes available
- Enable streaming in Sonauto API request payload
- Handle GENERATING_STREAMING_READY webhook status
- Add /api/stream/{session_id} proxy endpoint using httpx
- Update StatusResponse with streaming_ready and task_id fields
- Add audio player UI with autoplay fallback for mobile
- Fade out audio gracefully before redirect to result page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 08:23:14 -06:00
Harshad
58da81fd73 feat(backend): admin dashboard api 2026-02-01 19:38:11 +05:30
michael
9d53adaaf3 Add backend API, video generator, and frontend updates
- Add Python/FastAPI backend with Celery workers
- Add video generation with FFmpeg (spinning record animation)
- Add API endpoints: submissions, status polling, webhook, results
- Add database schema and Alembic migrations
- Update frontend pages with API integration
- Add project documentation and spec

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 10:31:58 -06:00