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
This commit is contained in:
parent
ccc93ffb3b
commit
59d79cd03d
2 changed files with 17 additions and 2 deletions
12
app.py
12
app.py
|
|
@ -1145,6 +1145,18 @@ def admin_request(rid):
|
||||||
flash('Stems share link saved.', 'success')
|
flash('Stems share link saved.', 'success')
|
||||||
return redirect(url_for('admin_request', rid=rid))
|
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':
|
elif action == 'cancel_request':
|
||||||
update_request(rid, status='cancelled')
|
update_request(rid, status='cancelled')
|
||||||
flash('Request marked as cancelled.', 'success')
|
flash('Request marked as cancelled.', 'success')
|
||||||
|
|
|
||||||
|
|
@ -454,13 +454,16 @@
|
||||||
<!-- Stems / Extras Link -->
|
<!-- Stems / Extras Link -->
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<h2>Stems / Extras Link</h2>
|
<h2>Stems / Extras Link</h2>
|
||||||
<p class="copy-hint">Paste a self-hosted file share link (e.g. from Pingvin Share). It will appear on the customer player page once delivered.</p>
|
<p class="copy-hint">Auto-generated from Gokapi when stems are completed. You can also paste a custom share link here — it will appear in the delivery email.</p>
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
<input type="hidden" name="action" value="save_stems_link">
|
<input type="hidden" name="action" value="save_stems_link">
|
||||||
<label for="stems_link">Share link</label>
|
<label for="stems_link">Share link</label>
|
||||||
<input type="url" id="stems_link" name="stems_link" value="{{ req.stems_link or '' }}" placeholder="https://files.dionysismedia.ca/share/...">
|
<input type="url" id="stems_link" name="stems_link" value="{{ req.stems_link or '' }}" placeholder="https://files.dionysismedia.ca/d?id=...">
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button type="submit" class="secondary">Save Link</button>
|
<button type="submit" class="secondary">Save Link</button>
|
||||||
|
{% if req.stems_url and not req.stems_link %}
|
||||||
|
<button type="submit" name="action" value="reprocess_stems" class="secondary">Re-upload to Gokapi</button>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue