karaoke-gen 0.103.1__py3-none-any.whl → 0.107.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- backend/Dockerfile.base +1 -0
- backend/api/routes/admin.py +226 -3
- backend/api/routes/push.py +238 -0
- backend/api/routes/users.py +14 -3
- backend/config.py +12 -1
- backend/main.py +2 -1
- backend/models/job.py +4 -0
- backend/models/user.py +20 -2
- backend/services/encoding_interface.py +4 -0
- backend/services/gce_encoding/main.py +22 -8
- backend/services/job_manager.py +68 -11
- backend/services/job_notification_service.py +4 -21
- backend/services/push_notification_service.py +409 -0
- backend/services/stripe_service.py +2 -2
- backend/tests/conftest.py +2 -1
- backend/tests/test_admin_delete_outputs.py +352 -0
- backend/tests/test_gce_encoding_worker.py +229 -0
- backend/tests/test_impersonation.py +18 -3
- backend/tests/test_job_notification_service.py +24 -58
- backend/tests/test_push_notification_service.py +460 -0
- backend/tests/test_push_routes.py +357 -0
- backend/tests/test_stripe_service.py +205 -0
- backend/tests/test_video_worker_orchestrator.py +189 -0
- backend/workers/video_worker_orchestrator.py +23 -0
- karaoke_gen/instrumental_review/server.py +145 -35
- karaoke_gen/nextjs_frontend/__init__.py +98 -0
- karaoke_gen/nextjs_frontend/out/404/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/404.html +1 -0
- karaoke_gen/nextjs_frontend/out/__next.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/__next._full.txt +22 -0
- karaoke_gen/nextjs_frontend/out/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/01a7f8fe40f1ff47.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/112f346e31f991df.js +4 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/16d1a4dd9d8a873a.js +3 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/1ab85c362b8b0e86.js +9 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/247eb132b7f7b574.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/2b80d15cc95e4818.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/32c7eba5cd46c1bc.js +7 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/483f26794eae53d0.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/550c3b02e85f196a.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/55c5ade44387bef8.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/5628d92b5893add2.css +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/56ebf7665e4341c8.js +7 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/5997132b61dec430.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/5ea55255bce3eb9e.js +5 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/5eda89a57490b3cd.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/692f5d9e0d700c76.js +3 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/71d7a05b14f9f0f4.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/81ac355749ef3302.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/95f7e5934dbb0e5d.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/9bce8f19eaa46940.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/a6dad97d9634a72d.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/a9ed54eed3e14c92.js +2 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/b35cd41238ecfb17.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/b5bc3c3d5ebd49eb.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/b5c078c08db5ae32.js +5 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/be9c44a178104187.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/c4c840e18cb4861c.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/c645af7d6b65f73e.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/d2c5e2575df784d4.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/d30af02b96d81462.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/d9bdf64f4ec1e9b7.js +7 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/dcde6ed684dacd0e.js +5 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/e422cbe931246000.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/e483af34fc792d38.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/e57422aad6b897da.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/ef02697fb404726a.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/ff1a16fafef87110.js +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/chunks/turbopack-2d9ca3017a9deedf.js +3 -0
- karaoke_gen/nextjs_frontend/out/_next/static/zpw_-rjFIDV5tlPPtnvRI/_buildManifest.js +11 -0
- karaoke_gen/nextjs_frontend/out/_next/static/zpw_-rjFIDV5tlPPtnvRI/_clientMiddlewareManifest.json +1 -0
- karaoke_gen/nextjs_frontend/out/_next/static/zpw_-rjFIDV5tlPPtnvRI/_ssgManifest.js +1 -0
- karaoke_gen/nextjs_frontend/out/_not-found/__next._full.txt +18 -0
- karaoke_gen/nextjs_frontend/out/_not-found/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/_not-found/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/_not-found/__next._not-found.__PAGE__.txt +5 -0
- karaoke_gen/nextjs_frontend/out/_not-found/__next._not-found.txt +4 -0
- karaoke_gen/nextjs_frontend/out/_not-found/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/_not-found/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/_not-found/index.txt +18 -0
- karaoke_gen/nextjs_frontend/out/admin/__next._full.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/admin/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/admin/__next.admin.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/__next.admin.txt +7 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/__next._full.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/__next.admin.beta.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/__next.admin.beta.txt +4 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/__next.admin.txt +7 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/admin/beta/index.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/admin/index.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/__next._full.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/__next.admin.jobs.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/__next.admin.jobs.txt +4 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/__next.admin.txt +7 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/admin/jobs/index.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/__next._full.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/__next.admin.rate-limits.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/__next.admin.rate-limits.txt +4 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/__next.admin.txt +7 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/admin/rate-limits/index.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/__next._full.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/__next.admin.searches.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/__next.admin.searches.txt +4 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/__next.admin.txt +7 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/admin/searches/index.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/users/__next._full.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/users/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/admin/users/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/users/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/admin/users/__next.admin.txt +7 -0
- karaoke_gen/nextjs_frontend/out/admin/users/__next.admin.users.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/users/__next.admin.users.txt +4 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/__next._full.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/__next.admin.txt +7 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/__next.admin.users.detail.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/__next.admin.users.detail.txt +4 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/__next.admin.users.txt +4 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/admin/users/detail/index.txt +25 -0
- karaoke_gen/nextjs_frontend/out/admin/users/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/admin/users/index.txt +25 -0
- karaoke_gen/nextjs_frontend/out/app/__next._full.txt +22 -0
- karaoke_gen/nextjs_frontend/out/app/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/app/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/app/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/app/__next.app.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/app/__next.app.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/app/index.txt +22 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/__next._full.txt +19 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/__next.app.jobs.$oc$slug.__PAGE__.txt +6 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/__next.app.jobs.$oc$slug.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/__next.app.jobs.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/__next.app.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/index.txt +19 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/__next._full.txt +19 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/__next.app.jobs.$oc$slug.__PAGE__.txt +6 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/__next.app.jobs.$oc$slug.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/__next.app.jobs.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/__next.app.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/instrumental/index.txt +19 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/__next._full.txt +19 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/__next.app.jobs.$oc$slug.__PAGE__.txt +6 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/__next.app.jobs.$oc$slug.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/__next.app.jobs.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/__next.app.txt +4 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/app/jobs/local/review/index.txt +19 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/__next._full.txt +22 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/__next.auth.txt +4 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/__next.auth.verify.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/__next.auth.verify.txt +4 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/auth/verify/index.txt +22 -0
- karaoke_gen/nextjs_frontend/out/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/index.txt +22 -0
- karaoke_gen/nextjs_frontend/out/manifest.webmanifest +31 -0
- karaoke_gen/nextjs_frontend/out/order/success/__next._full.txt +22 -0
- karaoke_gen/nextjs_frontend/out/order/success/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/order/success/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/order/success/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/order/success/__next.order.success.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/order/success/__next.order.success.txt +4 -0
- karaoke_gen/nextjs_frontend/out/order/success/__next.order.txt +4 -0
- karaoke_gen/nextjs_frontend/out/order/success/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/order/success/index.txt +22 -0
- karaoke_gen/nextjs_frontend/out/payment/success/__next._full.txt +22 -0
- karaoke_gen/nextjs_frontend/out/payment/success/__next._head.txt +8 -0
- karaoke_gen/nextjs_frontend/out/payment/success/__next._index.txt +9 -0
- karaoke_gen/nextjs_frontend/out/payment/success/__next._tree.txt +2 -0
- karaoke_gen/nextjs_frontend/out/payment/success/__next.payment.success.__PAGE__.txt +9 -0
- karaoke_gen/nextjs_frontend/out/payment/success/__next.payment.success.txt +4 -0
- karaoke_gen/nextjs_frontend/out/payment/success/__next.payment.txt +4 -0
- karaoke_gen/nextjs_frontend/out/payment/success/index.html +1 -0
- karaoke_gen/nextjs_frontend/out/payment/success/index.txt +22 -0
- karaoke_gen/nextjs_frontend/out/screenshots/email-action_reminder.png +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/email-beta_welcome.png +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/email-job_completion.png +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/example-output.avif +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/homepage-full.png +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/homepage-hero.png +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/instrumental-review.avif +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/instrumental-review.png +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/job-dashboard.avif +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/lyrics-review.avif +0 -0
- karaoke_gen/nextjs_frontend/out/screenshots/lyrics-review.png +0 -0
- karaoke_gen/nextjs_frontend/out/sw.js +183 -0
- karaoke_gen/utils/cli_args.py +3 -3
- karaoke_gen/utils/gen_cli.py +4 -0
- karaoke_gen/utils/remote_cli.py +8 -40
- {karaoke_gen-0.103.1.dist-info → karaoke_gen-0.107.0.dist-info}/METADATA +2 -1
- {karaoke_gen-0.103.1.dist-info → karaoke_gen-0.107.0.dist-info}/RECORD +244 -131
- {karaoke_gen-0.103.1.dist-info → karaoke_gen-0.107.0.dist-info}/WHEEL +1 -1
- lyrics_transcriber/correction/agentic/agent.py +83 -60
- lyrics_transcriber/correction/anchor_sequence.py +48 -3
- lyrics_transcriber/correction/corrector.py +92 -58
- lyrics_transcriber/review/server.py +165 -33
- lyrics_transcriber/utils/tracing.py +214 -0
- karaoke_gen/instrumental_review/static/index.html +0 -1695
- lyrics_transcriber/frontend/.gitignore +0 -24
- lyrics_transcriber/frontend/.yarn/releases/yarn-4.7.0.cjs +0 -935
- lyrics_transcriber/frontend/.yarnrc.yml +0 -3
- lyrics_transcriber/frontend/README.md +0 -50
- lyrics_transcriber/frontend/REPLACE_ALL_FUNCTIONALITY.md +0 -210
- lyrics_transcriber/frontend/__init__.py +0 -25
- lyrics_transcriber/frontend/e2e/agentic-corrections.spec.ts +0 -207
- lyrics_transcriber/frontend/e2e/fixtures/agentic-correction-data.json +0 -226
- lyrics_transcriber/frontend/eslint.config.js +0 -28
- lyrics_transcriber/frontend/index.html +0 -22
- lyrics_transcriber/frontend/package-lock.json +0 -4553
- lyrics_transcriber/frontend/package.json +0 -48
- lyrics_transcriber/frontend/playwright.config.ts +0 -69
- lyrics_transcriber/frontend/public/android-chrome-192x192.png +0 -0
- lyrics_transcriber/frontend/public/android-chrome-512x512.png +0 -0
- lyrics_transcriber/frontend/src/App.tsx +0 -243
- lyrics_transcriber/frontend/src/api.ts +0 -262
- lyrics_transcriber/frontend/src/components/AIFeedbackModal.tsx +0 -111
- lyrics_transcriber/frontend/src/components/AddLyricsModal.tsx +0 -114
- lyrics_transcriber/frontend/src/components/AgenticCorrectionMetrics.tsx +0 -204
- lyrics_transcriber/frontend/src/components/AppHeader.tsx +0 -65
- lyrics_transcriber/frontend/src/components/AudioPlayer.tsx +0 -180
- lyrics_transcriber/frontend/src/components/CorrectedWordWithActions.tsx +0 -175
- lyrics_transcriber/frontend/src/components/CorrectionAnnotationModal.tsx +0 -359
- lyrics_transcriber/frontend/src/components/CorrectionDetailCard.tsx +0 -281
- lyrics_transcriber/frontend/src/components/CorrectionMetrics.tsx +0 -162
- lyrics_transcriber/frontend/src/components/DurationTimelineView.tsx +0 -257
- lyrics_transcriber/frontend/src/components/EditActionBar.tsx +0 -94
- lyrics_transcriber/frontend/src/components/EditModal.tsx +0 -720
- lyrics_transcriber/frontend/src/components/EditTimelineSection.tsx +0 -592
- lyrics_transcriber/frontend/src/components/EditWordList.tsx +0 -431
- lyrics_transcriber/frontend/src/components/FileUpload.tsx +0 -77
- lyrics_transcriber/frontend/src/components/FindReplaceModal.tsx +0 -467
- lyrics_transcriber/frontend/src/components/Header.tsx +0 -520
- lyrics_transcriber/frontend/src/components/LyricsAnalyzer.tsx +0 -1526
- lyrics_transcriber/frontend/src/components/LyricsSynchronizer/SyncControls.tsx +0 -216
- lyrics_transcriber/frontend/src/components/LyricsSynchronizer/TimelineCanvas.tsx +0 -721
- lyrics_transcriber/frontend/src/components/LyricsSynchronizer/UpcomingWordsBar.tsx +0 -80
- lyrics_transcriber/frontend/src/components/LyricsSynchronizer/index.tsx +0 -999
- lyrics_transcriber/frontend/src/components/MetricsDashboard.tsx +0 -51
- lyrics_transcriber/frontend/src/components/ModeSelectionModal.tsx +0 -127
- lyrics_transcriber/frontend/src/components/ModeSelector.tsx +0 -67
- lyrics_transcriber/frontend/src/components/ModelSelector.tsx +0 -23
- lyrics_transcriber/frontend/src/components/PreviewVideoSection.tsx +0 -177
- lyrics_transcriber/frontend/src/components/ReferenceView.tsx +0 -268
- lyrics_transcriber/frontend/src/components/ReplaceAllLyricsModal.tsx +0 -336
- lyrics_transcriber/frontend/src/components/ReviewChangesModal.tsx +0 -354
- lyrics_transcriber/frontend/src/components/SegmentDetailsModal.tsx +0 -64
- lyrics_transcriber/frontend/src/components/TimelineEditor.tsx +0 -383
- lyrics_transcriber/frontend/src/components/TimingOffsetModal.tsx +0 -131
- lyrics_transcriber/frontend/src/components/TranscriptionView.tsx +0 -266
- lyrics_transcriber/frontend/src/components/WordDivider.tsx +0 -191
- lyrics_transcriber/frontend/src/components/shared/components/HighlightedText.tsx +0 -466
- lyrics_transcriber/frontend/src/components/shared/components/SourceSelector.tsx +0 -56
- lyrics_transcriber/frontend/src/components/shared/components/Word.tsx +0 -89
- lyrics_transcriber/frontend/src/components/shared/constants.ts +0 -30
- lyrics_transcriber/frontend/src/components/shared/hooks/useWordClick.ts +0 -180
- lyrics_transcriber/frontend/src/components/shared/styles.ts +0 -13
- lyrics_transcriber/frontend/src/components/shared/types.js +0 -2
- lyrics_transcriber/frontend/src/components/shared/types.ts +0 -135
- lyrics_transcriber/frontend/src/components/shared/utils/keyboardHandlers.ts +0 -177
- lyrics_transcriber/frontend/src/components/shared/utils/localStorage.ts +0 -78
- lyrics_transcriber/frontend/src/components/shared/utils/referenceLineCalculator.ts +0 -75
- lyrics_transcriber/frontend/src/components/shared/utils/segmentOperations.ts +0 -360
- lyrics_transcriber/frontend/src/components/shared/utils/timingUtils.ts +0 -110
- lyrics_transcriber/frontend/src/components/shared/utils/wordUtils.ts +0 -22
- lyrics_transcriber/frontend/src/hooks/useManualSync.ts +0 -537
- lyrics_transcriber/frontend/src/main.tsx +0 -11
- lyrics_transcriber/frontend/src/theme.ts +0 -406
- lyrics_transcriber/frontend/src/types/global.d.ts +0 -9
- lyrics_transcriber/frontend/src/types.js +0 -2
- lyrics_transcriber/frontend/src/types.ts +0 -199
- lyrics_transcriber/frontend/src/validation.ts +0 -132
- lyrics_transcriber/frontend/src/vite-env.d.ts +0 -1
- lyrics_transcriber/frontend/tsconfig.app.json +0 -26
- lyrics_transcriber/frontend/tsconfig.json +0 -25
- lyrics_transcriber/frontend/tsconfig.node.json +0 -23
- lyrics_transcriber/frontend/tsconfig.tsbuildinfo +0 -1
- lyrics_transcriber/frontend/update_version.js +0 -11
- lyrics_transcriber/frontend/vite.config.d.ts +0 -2
- lyrics_transcriber/frontend/vite.config.js +0 -15
- lyrics_transcriber/frontend/vite.config.ts +0 -16
- lyrics_transcriber/frontend/web_assets/android-chrome-192x192.png +0 -0
- lyrics_transcriber/frontend/web_assets/android-chrome-512x512.png +0 -0
- lyrics_transcriber/frontend/web_assets/apple-touch-icon.png +0 -0
- lyrics_transcriber/frontend/web_assets/assets/index-BSMgOq4Z.js +0 -44465
- lyrics_transcriber/frontend/web_assets/assets/index-BSMgOq4Z.js.map +0 -1
- lyrics_transcriber/frontend/web_assets/favicon-16x16.png +0 -0
- lyrics_transcriber/frontend/web_assets/favicon-32x32.png +0 -0
- lyrics_transcriber/frontend/web_assets/favicon.ico +0 -0
- lyrics_transcriber/frontend/web_assets/index.html +0 -22
- lyrics_transcriber/frontend/web_assets/nomad-karaoke-logo.png +0 -0
- lyrics_transcriber/frontend/web_assets/nomad-karaoke-logo.svg +0 -5
- lyrics_transcriber/frontend/yarn.lock +0 -3711
- {lyrics_transcriber/frontend/public → karaoke_gen/nextjs_frontend/out}/apple-touch-icon.png +0 -0
- {lyrics_transcriber/frontend/public → karaoke_gen/nextjs_frontend/out}/favicon-16x16.png +0 -0
- {lyrics_transcriber/frontend/public → karaoke_gen/nextjs_frontend/out}/favicon-32x32.png +0 -0
- {lyrics_transcriber/frontend/public → karaoke_gen/nextjs_frontend/out}/favicon.ico +0 -0
- {lyrics_transcriber/frontend/public → karaoke_gen/nextjs_frontend/out}/nomad-karaoke-logo.svg +0 -0
- /lyrics_transcriber/frontend/public/nomad-karaoke-logo.png → /karaoke_gen/nextjs_frontend/out/nomad-logo.png +0 -0
- {karaoke_gen-0.103.1.dist-info → karaoke_gen-0.107.0.dist-info}/entry_points.txt +0 -0
- {karaoke_gen-0.103.1.dist-info → karaoke_gen-0.107.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
type Metrics = {
|
|
4
|
-
timeRange: string;
|
|
5
|
-
totalSessions: number;
|
|
6
|
-
averageAccuracy: number;
|
|
7
|
-
errorReduction: number;
|
|
8
|
-
averageProcessingTime: number;
|
|
9
|
-
modelPerformance: { counts: Record<string, number>; avgLatencyMs: Record<string, number>; fallbacks: number };
|
|
10
|
-
costSummary: Record<string, number>;
|
|
11
|
-
userSatisfaction: number;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
type Props = { metrics: Metrics };
|
|
15
|
-
|
|
16
|
-
export const MetricsDashboard: React.FC<Props> = ({ metrics }) => {
|
|
17
|
-
const modelIds = Object.keys(metrics.modelPerformance.counts || {});
|
|
18
|
-
return (
|
|
19
|
-
<div>
|
|
20
|
-
<h3>Agentic Metrics</h3>
|
|
21
|
-
<div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 12 }}>
|
|
22
|
-
<div><b>Total Sessions</b><div>{metrics.totalSessions}</div></div>
|
|
23
|
-
<div><b>Avg Proc Time (ms)</b><div>{metrics.averageProcessingTime}</div></div>
|
|
24
|
-
<div><b>Fallbacks</b><div>{metrics.modelPerformance.fallbacks}</div></div>
|
|
25
|
-
</div>
|
|
26
|
-
<h4 style={{ marginTop: 16 }}>Per-Model</h4>
|
|
27
|
-
<table style={{ width: "100%", borderCollapse: "collapse" }}>
|
|
28
|
-
<thead>
|
|
29
|
-
<tr>
|
|
30
|
-
<th style={{ textAlign: "left" }}>Model</th>
|
|
31
|
-
<th style={{ textAlign: "right" }}>Count</th>
|
|
32
|
-
<th style={{ textAlign: "right" }}>Avg Latency (ms)</th>
|
|
33
|
-
</tr>
|
|
34
|
-
</thead>
|
|
35
|
-
<tbody>
|
|
36
|
-
{modelIds.map((id) => (
|
|
37
|
-
<tr key={id}>
|
|
38
|
-
<td>{id}</td>
|
|
39
|
-
<td style={{ textAlign: "right" }}>{metrics.modelPerformance.counts[id] || 0}</td>
|
|
40
|
-
<td style={{ textAlign: "right" }}>{metrics.modelPerformance.avgLatencyMs[id] || 0}</td>
|
|
41
|
-
</tr>
|
|
42
|
-
))}
|
|
43
|
-
</tbody>
|
|
44
|
-
</table>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default MetricsDashboard;
|
|
50
|
-
|
|
51
|
-
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Dialog,
|
|
3
|
-
DialogTitle,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogActions,
|
|
6
|
-
IconButton,
|
|
7
|
-
Box,
|
|
8
|
-
Button,
|
|
9
|
-
Typography,
|
|
10
|
-
Paper
|
|
11
|
-
} from '@mui/material'
|
|
12
|
-
import CloseIcon from '@mui/icons-material/Close'
|
|
13
|
-
import ContentPasteIcon from '@mui/icons-material/ContentPaste'
|
|
14
|
-
import SyncIcon from '@mui/icons-material/Sync'
|
|
15
|
-
|
|
16
|
-
interface ModeSelectionModalProps {
|
|
17
|
-
open: boolean
|
|
18
|
-
onClose: () => void
|
|
19
|
-
onSelectReplace: () => void // Goes to paste phase for replacing all lyrics
|
|
20
|
-
onSelectResync: () => void // Goes directly to sync view with existing lyrics
|
|
21
|
-
hasExistingLyrics: boolean // Whether there are existing lyrics to re-sync
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default function ModeSelectionModal({
|
|
25
|
-
open,
|
|
26
|
-
onClose,
|
|
27
|
-
onSelectReplace,
|
|
28
|
-
onSelectResync,
|
|
29
|
-
hasExistingLyrics
|
|
30
|
-
}: ModeSelectionModalProps) {
|
|
31
|
-
return (
|
|
32
|
-
<Dialog
|
|
33
|
-
open={open}
|
|
34
|
-
onClose={onClose}
|
|
35
|
-
maxWidth="sm"
|
|
36
|
-
fullWidth
|
|
37
|
-
>
|
|
38
|
-
<DialogTitle sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
|
39
|
-
<Box sx={{ flex: 1 }}>
|
|
40
|
-
Edit All Lyrics
|
|
41
|
-
</Box>
|
|
42
|
-
<IconButton onClick={onClose} sx={{ ml: 'auto' }}>
|
|
43
|
-
<CloseIcon />
|
|
44
|
-
</IconButton>
|
|
45
|
-
</DialogTitle>
|
|
46
|
-
|
|
47
|
-
<DialogContent dividers>
|
|
48
|
-
<Typography variant="body1" sx={{ mb: 3 }}>
|
|
49
|
-
Choose how you want to edit the lyrics:
|
|
50
|
-
</Typography>
|
|
51
|
-
|
|
52
|
-
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
|
53
|
-
{/* Re-sync Existing option - only show if there are existing lyrics */}
|
|
54
|
-
{hasExistingLyrics && (
|
|
55
|
-
<Paper
|
|
56
|
-
sx={{
|
|
57
|
-
p: 2,
|
|
58
|
-
cursor: 'pointer',
|
|
59
|
-
border: 2,
|
|
60
|
-
borderColor: 'primary.main',
|
|
61
|
-
'&:hover': {
|
|
62
|
-
bgcolor: 'action.hover',
|
|
63
|
-
borderColor: 'primary.dark'
|
|
64
|
-
}
|
|
65
|
-
}}
|
|
66
|
-
onClick={onSelectResync}
|
|
67
|
-
>
|
|
68
|
-
<Box sx={{ display: 'flex', alignItems: 'flex-start', gap: 2 }}>
|
|
69
|
-
<SyncIcon color="primary" sx={{ fontSize: 40, mt: 0.5 }} />
|
|
70
|
-
<Box>
|
|
71
|
-
<Typography variant="h6" color="primary">
|
|
72
|
-
Re-sync Existing Lyrics
|
|
73
|
-
</Typography>
|
|
74
|
-
<Typography variant="body2" color="text.secondary">
|
|
75
|
-
Keep the current lyrics text and fix timing issues.
|
|
76
|
-
Use this when lyrics are correct but timing has drifted,
|
|
77
|
-
especially in the second half of the song.
|
|
78
|
-
</Typography>
|
|
79
|
-
<Typography variant="caption" color="success.main" sx={{ mt: 1, display: 'block' }}>
|
|
80
|
-
Recommended for fixing timing drift
|
|
81
|
-
</Typography>
|
|
82
|
-
</Box>
|
|
83
|
-
</Box>
|
|
84
|
-
</Paper>
|
|
85
|
-
)}
|
|
86
|
-
|
|
87
|
-
{/* Replace All option */}
|
|
88
|
-
<Paper
|
|
89
|
-
sx={{
|
|
90
|
-
p: 2,
|
|
91
|
-
cursor: 'pointer',
|
|
92
|
-
border: 1,
|
|
93
|
-
borderColor: 'divider',
|
|
94
|
-
'&:hover': {
|
|
95
|
-
bgcolor: 'action.hover',
|
|
96
|
-
borderColor: 'text.secondary'
|
|
97
|
-
}
|
|
98
|
-
}}
|
|
99
|
-
onClick={onSelectReplace}
|
|
100
|
-
>
|
|
101
|
-
<Box sx={{ display: 'flex', alignItems: 'flex-start', gap: 2 }}>
|
|
102
|
-
<ContentPasteIcon sx={{ fontSize: 40, mt: 0.5, color: 'text.secondary' }} />
|
|
103
|
-
<Box>
|
|
104
|
-
<Typography variant="h6">
|
|
105
|
-
Replace All Lyrics
|
|
106
|
-
</Typography>
|
|
107
|
-
<Typography variant="body2" color="text.secondary">
|
|
108
|
-
Paste completely new lyrics from clipboard and manually
|
|
109
|
-
sync timing for all words from scratch.
|
|
110
|
-
</Typography>
|
|
111
|
-
<Typography variant="caption" color="warning.main" sx={{ mt: 1, display: 'block' }}>
|
|
112
|
-
All existing timing data will be lost
|
|
113
|
-
</Typography>
|
|
114
|
-
</Box>
|
|
115
|
-
</Box>
|
|
116
|
-
</Paper>
|
|
117
|
-
</Box>
|
|
118
|
-
</DialogContent>
|
|
119
|
-
|
|
120
|
-
<DialogActions>
|
|
121
|
-
<Button onClick={onClose} color="inherit">
|
|
122
|
-
Cancel
|
|
123
|
-
</Button>
|
|
124
|
-
</DialogActions>
|
|
125
|
-
</Dialog>
|
|
126
|
-
)
|
|
127
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ToggleButton, ToggleButtonGroup, Box, Typography, Tooltip } from '@mui/material';
|
|
2
|
-
import HighlightIcon from '@mui/icons-material/Highlight';
|
|
3
|
-
import EditIcon from '@mui/icons-material/Edit';
|
|
4
|
-
import DeleteIcon from '@mui/icons-material/Delete';
|
|
5
|
-
import { InteractionMode } from '../types';
|
|
6
|
-
|
|
7
|
-
interface ModeSelectorProps {
|
|
8
|
-
effectiveMode: InteractionMode;
|
|
9
|
-
onChange: (mode: InteractionMode) => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default function ModeSelector({ effectiveMode, onChange }: ModeSelectorProps) {
|
|
13
|
-
return (
|
|
14
|
-
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1.2, height: '32px' }}>
|
|
15
|
-
<Typography variant="body2" color="text.secondary" sx={{ fontSize: '0.8rem' }}>
|
|
16
|
-
Mode:
|
|
17
|
-
</Typography>
|
|
18
|
-
<ToggleButtonGroup
|
|
19
|
-
value={effectiveMode}
|
|
20
|
-
exclusive
|
|
21
|
-
onChange={(_, newMode) => newMode === 'edit' && onChange(newMode)}
|
|
22
|
-
size="small"
|
|
23
|
-
sx={{
|
|
24
|
-
height: '32px',
|
|
25
|
-
'& .MuiToggleButton-root': {
|
|
26
|
-
padding: '3px 8px',
|
|
27
|
-
fontSize: '0.75rem',
|
|
28
|
-
height: '32px'
|
|
29
|
-
}
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
<Tooltip title="Default mode; click words to edit that lyrics segment">
|
|
33
|
-
<ToggleButton
|
|
34
|
-
value="edit"
|
|
35
|
-
>
|
|
36
|
-
<EditIcon sx={{ mr: 0.5, fontSize: '1rem' }} />
|
|
37
|
-
Edit
|
|
38
|
-
</ToggleButton>
|
|
39
|
-
</Tooltip>
|
|
40
|
-
|
|
41
|
-
<Tooltip title="Hold SHIFT and click words to highlight the matching anchor sequence in the reference lyrics">
|
|
42
|
-
<span>
|
|
43
|
-
<ToggleButton
|
|
44
|
-
value="highlight"
|
|
45
|
-
disabled
|
|
46
|
-
>
|
|
47
|
-
<HighlightIcon sx={{ mr: 0.5, fontSize: '1rem' }} />
|
|
48
|
-
Highlight
|
|
49
|
-
</ToggleButton>
|
|
50
|
-
</span>
|
|
51
|
-
</Tooltip>
|
|
52
|
-
|
|
53
|
-
<Tooltip title="Hold CTRL and click words to delete them">
|
|
54
|
-
<span>
|
|
55
|
-
<ToggleButton
|
|
56
|
-
value="delete_word"
|
|
57
|
-
disabled
|
|
58
|
-
>
|
|
59
|
-
<DeleteIcon sx={{ mr: 0.5, fontSize: '1rem' }} />
|
|
60
|
-
Delete
|
|
61
|
-
</ToggleButton>
|
|
62
|
-
</span>
|
|
63
|
-
</Tooltip>
|
|
64
|
-
</ToggleButtonGroup>
|
|
65
|
-
</Box>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
type Props = {
|
|
4
|
-
models: { id: string; name: string; available: boolean }[];
|
|
5
|
-
value?: string;
|
|
6
|
-
onChange: (modelId: string) => void;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const ModelSelector: React.FC<Props> = ({ models, value, onChange }) => {
|
|
10
|
-
return (
|
|
11
|
-
<select value={value} onChange={(e) => onChange(e.target.value)}>
|
|
12
|
-
{models.map((m) => (
|
|
13
|
-
<option key={m.id} value={m.id} disabled={!m.available}>
|
|
14
|
-
{m.name} {m.available ? "" : "(unavailable)"}
|
|
15
|
-
</option>
|
|
16
|
-
))}
|
|
17
|
-
</select>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default ModelSelector;
|
|
22
|
-
|
|
23
|
-
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { Box, Typography, CircularProgress, Alert, Button, FormControlLabel, Checkbox } from '@mui/material'
|
|
2
|
-
import { useState, useEffect, useCallback } from 'react'
|
|
3
|
-
import { ApiClient } from '../api'
|
|
4
|
-
import { CorrectionData } from '../types'
|
|
5
|
-
import { applyOffsetToCorrectionData } from './shared/utils/timingUtils'
|
|
6
|
-
|
|
7
|
-
interface PreviewVideoSectionProps {
|
|
8
|
-
apiClient: ApiClient | null
|
|
9
|
-
isModalOpen: boolean
|
|
10
|
-
updatedData: CorrectionData
|
|
11
|
-
videoRef?: React.RefObject<HTMLVideoElement>
|
|
12
|
-
timingOffsetMs?: number
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default function PreviewVideoSection({
|
|
16
|
-
apiClient,
|
|
17
|
-
isModalOpen,
|
|
18
|
-
updatedData,
|
|
19
|
-
videoRef,
|
|
20
|
-
timingOffsetMs = 0
|
|
21
|
-
}: PreviewVideoSectionProps) {
|
|
22
|
-
const [previewState, setPreviewState] = useState<{
|
|
23
|
-
status: 'loading' | 'ready' | 'error';
|
|
24
|
-
videoUrl?: string;
|
|
25
|
-
error?: string;
|
|
26
|
-
}>({ status: 'loading' });
|
|
27
|
-
|
|
28
|
-
// Toggle for rendering with theme background image (slower) vs black background (faster)
|
|
29
|
-
const [useBackgroundImage, setUseBackgroundImage] = useState(false);
|
|
30
|
-
|
|
31
|
-
// Memoized function to generate preview
|
|
32
|
-
const generatePreview = useCallback(async () => {
|
|
33
|
-
if (!apiClient) return;
|
|
34
|
-
|
|
35
|
-
setPreviewState({ status: 'loading' });
|
|
36
|
-
try {
|
|
37
|
-
// Debug logging for timing offset
|
|
38
|
-
console.log(`[TIMING] PreviewVideoSection - Current timing offset: ${timingOffsetMs}ms`);
|
|
39
|
-
console.log(`[PREVIEW] Using background image: ${useBackgroundImage}`);
|
|
40
|
-
|
|
41
|
-
// Apply timing offset if needed
|
|
42
|
-
const dataToPreview = timingOffsetMs !== 0
|
|
43
|
-
? applyOffsetToCorrectionData(updatedData, timingOffsetMs)
|
|
44
|
-
: updatedData;
|
|
45
|
-
|
|
46
|
-
// Log some example timestamps after potential offset application
|
|
47
|
-
if (dataToPreview.corrected_segments.length > 0) {
|
|
48
|
-
const firstSegment = dataToPreview.corrected_segments[0];
|
|
49
|
-
console.log(`[TIMING] Preview - First segment id: ${firstSegment.id}`);
|
|
50
|
-
console.log(`[TIMING] - start_time: ${firstSegment.start_time}, end_time: ${firstSegment.end_time}`);
|
|
51
|
-
|
|
52
|
-
if (firstSegment.words.length > 0) {
|
|
53
|
-
const firstWord = firstSegment.words[0];
|
|
54
|
-
console.log(`[TIMING] - first word "${firstWord.text}" time: ${firstWord.start_time} -> ${firstWord.end_time}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const response = await apiClient.generatePreviewVideo(dataToPreview, {
|
|
59
|
-
use_background_image: useBackgroundImage
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
if (response.status === 'error') {
|
|
63
|
-
setPreviewState({
|
|
64
|
-
status: 'error',
|
|
65
|
-
error: response.message || 'Failed to generate preview video'
|
|
66
|
-
});
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (!response.preview_hash) {
|
|
71
|
-
setPreviewState({
|
|
72
|
-
status: 'error',
|
|
73
|
-
error: 'No preview hash received from server'
|
|
74
|
-
});
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const videoUrl = apiClient.getPreviewVideoUrl(response.preview_hash);
|
|
79
|
-
setPreviewState({
|
|
80
|
-
status: 'ready',
|
|
81
|
-
videoUrl
|
|
82
|
-
});
|
|
83
|
-
} catch (error) {
|
|
84
|
-
setPreviewState({
|
|
85
|
-
status: 'error',
|
|
86
|
-
error: (error as Error).message || 'Failed to generate preview video'
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}, [apiClient, updatedData, timingOffsetMs, useBackgroundImage]);
|
|
90
|
-
|
|
91
|
-
// Generate preview when modal opens or when background toggle changes
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
if (isModalOpen && apiClient) {
|
|
94
|
-
generatePreview();
|
|
95
|
-
}
|
|
96
|
-
}, [isModalOpen, apiClient, generatePreview]);
|
|
97
|
-
|
|
98
|
-
if (!apiClient) return null;
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<Box sx={{ mb: 2 }}>
|
|
102
|
-
{/* Background image toggle */}
|
|
103
|
-
<Box sx={{ px: 2, pt: 2, pb: 1 }}>
|
|
104
|
-
<FormControlLabel
|
|
105
|
-
control={
|
|
106
|
-
<Checkbox
|
|
107
|
-
checked={useBackgroundImage}
|
|
108
|
-
onChange={(e) => setUseBackgroundImage(e.target.checked)}
|
|
109
|
-
disabled={previewState.status === 'loading'}
|
|
110
|
-
size="small"
|
|
111
|
-
/>
|
|
112
|
-
}
|
|
113
|
-
label={
|
|
114
|
-
<Box>
|
|
115
|
-
<Typography variant="body2" component="span">
|
|
116
|
-
Render with theme background
|
|
117
|
-
</Typography>
|
|
118
|
-
<Typography variant="caption" color="text.secondary" display="block">
|
|
119
|
-
Preview uses black background for speed (~10s). Enable for theme background (~30-60s).
|
|
120
|
-
</Typography>
|
|
121
|
-
</Box>
|
|
122
|
-
}
|
|
123
|
-
/>
|
|
124
|
-
</Box>
|
|
125
|
-
|
|
126
|
-
{previewState.status === 'loading' && (
|
|
127
|
-
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2, p: 2 }}>
|
|
128
|
-
<CircularProgress size={24} />
|
|
129
|
-
<Typography>Generating preview video{useBackgroundImage ? ' with theme background' : ''}...</Typography>
|
|
130
|
-
</Box>
|
|
131
|
-
)}
|
|
132
|
-
|
|
133
|
-
{previewState.status === 'error' && (
|
|
134
|
-
<Box sx={{ mb: 2 }}>
|
|
135
|
-
<Alert
|
|
136
|
-
severity="error"
|
|
137
|
-
action={
|
|
138
|
-
<Button
|
|
139
|
-
color="inherit"
|
|
140
|
-
size="small"
|
|
141
|
-
onClick={() => {
|
|
142
|
-
// Re-trigger the effect by toggling isModalOpen
|
|
143
|
-
setPreviewState({ status: 'loading' });
|
|
144
|
-
}}
|
|
145
|
-
>
|
|
146
|
-
Retry
|
|
147
|
-
</Button>
|
|
148
|
-
}
|
|
149
|
-
>
|
|
150
|
-
{previewState.error}
|
|
151
|
-
</Alert>
|
|
152
|
-
</Box>
|
|
153
|
-
)}
|
|
154
|
-
|
|
155
|
-
{previewState.status === 'ready' && previewState.videoUrl && (
|
|
156
|
-
<Box sx={{
|
|
157
|
-
width: '100%',
|
|
158
|
-
margin: '0',
|
|
159
|
-
}}>
|
|
160
|
-
<video
|
|
161
|
-
ref={videoRef}
|
|
162
|
-
controls
|
|
163
|
-
autoPlay
|
|
164
|
-
src={previewState.videoUrl}
|
|
165
|
-
style={{
|
|
166
|
-
display: 'block',
|
|
167
|
-
width: '100%',
|
|
168
|
-
height: 'auto',
|
|
169
|
-
}}
|
|
170
|
-
>
|
|
171
|
-
Your browser does not support the video tag.
|
|
172
|
-
</video>
|
|
173
|
-
</Box>
|
|
174
|
-
)}
|
|
175
|
-
</Box>
|
|
176
|
-
);
|
|
177
|
-
}
|