From 59d79cd03d76535cbd79a50b1586395e967c3b1b Mon Sep 17 00:00:00 2001 From: "Troll (Hermes Agent)" Date: Tue, 11 Aug 2026 20:48:46 +0000 Subject: [PATCH] Add Re-upload to Gokapi button for existing stems - New reprocess_stems admin action triggers Gokapi upload manually - Button appears in Stems/Extras Link section when stems_url exists but stems_link is empty (webhook fired before Gokapi was configured) - Updated share link description and placeholder for Gokapi URLs --- app.py | 12 ++++++++++++ templates/admin/request.html | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index cb0c975..56e9038 100644 --- a/app.py +++ b/app.py @@ -1145,6 +1145,18 @@ def admin_request(rid): flash('Stems share link saved.', 'success') return redirect(url_for('admin_request', rid=rid)) + elif action == 'reprocess_stems': + # Manually trigger Gokapi upload for existing stems (e.g. webhook fired before Gokapi was configured). + if not req.get('stems_url'): + flash('No stems files to process.', 'error') + return redirect(url_for('admin_request', rid=rid)) + gokapi_url, gokapi_err = process_stems_to_gokapi(req) + if gokapi_err: + flash(f'Failed to upload stems to Gokapi: {gokapi_err}', 'error') + else: + flash(f'Stems uploaded to Gokapi: {gokapi_url}', 'success') + return redirect(url_for('admin_request', rid=rid)) + elif action == 'cancel_request': update_request(rid, status='cancelled') flash('Request marked as cancelled.', 'success') diff --git a/templates/admin/request.html b/templates/admin/request.html index 99555d0..19b2b67 100644 --- a/templates/admin/request.html +++ b/templates/admin/request.html @@ -454,13 +454,16 @@

Stems / Extras Link

-

Paste a self-hosted file share link (e.g. from Pingvin Share). It will appear on the customer player page once delivered.

+

Auto-generated from Gokapi when stems are completed. You can also paste a custom share link here — it will appear in the delivery email.

- +
+ {% if req.stems_url and not req.stems_link %} + + {% endif %}