add backfill vocal isolation button to shop settings

This commit is contained in:
russell@unturf.com 2026-02-18 11:34:08 -05:00
parent 44e0210d5e
commit 0ad82d5314
2 changed files with 22 additions and 0 deletions

View file

@ -455,6 +455,15 @@
</form>
{% if request.shop.unsandbox_public_key and request.shop.unsandbox_secret_key %}
<form method="post" action="/s/{{ request.shop.id }}/settings" onsubmit="this.querySelector('[type=submit]').disabled = true; return true;">
<input type="hidden" name="form_section" value="backfill-karaoke" />
<input type="submit" class="mps-submit" value="Backfill Vocal Isolation" />
<br />
<small>Process all existing audio/video products for vocal isolation. Runs in background.</small>
</form>
{% endif %}
</section>
</section>

View file

@ -809,6 +809,19 @@ def shop_settings(request):
)
request.session.flash(("Backfilling vocal isolation for existing catalog in background.", "success"))
# Handle backfill karaoke button
if form_section == "backfill-karaoke":
if shop.unsandbox_public_key and shop.unsandbox_secret_key:
from ..lib.karaoke import backfill_karaoke_async
backfill_karaoke_async(
shop.id,
request.registry["dbsession_factory"],
request.app,
)
request.session.flash(("Backfilling vocal isolation for existing catalog in background.", "success"))
else:
request.session.flash(("Set unsandbox API keys first.", "error"))
# Handle maintenance settings form
if form_section == "maintenance-settings":
if shop.maint_mode != maint_mode: