Merge branch 'development' of gitea.centx.de:lelo/bethaus-app into development
This commit is contained in:
commit
2c6b856f66
@ -17,8 +17,6 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- FLASK_APP=app.py
|
- FLASK_APP=app.py
|
||||||
- FLASK_ENV=production
|
- FLASK_ENV=production
|
||||||
- TITLE_SHORT=${TITLE_SHORT}
|
|
||||||
- TITLE_LONG=${TITLE_LONG}
|
|
||||||
networks:
|
networks:
|
||||||
- traefik
|
- traefik
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
@ -101,30 +101,34 @@ audio.onended = function() {
|
|||||||
|
|
||||||
|
|
||||||
async function downloadAudio() {
|
async function downloadAudio() {
|
||||||
const src = audio.currentSrc;
|
const src = audio.currentSrc || audio.src;
|
||||||
if (!src) return;
|
if (!src) return;
|
||||||
|
|
||||||
// Fetch with credentials / correct mode
|
// Build a fresh URL every time
|
||||||
const response = await fetch(src, { credentials: 'same-origin' });
|
const requestUrl = new URL(src, window.location.href);
|
||||||
if (!response.ok) throw new Error(`Download failed: ${response.status}`);
|
requestUrl.searchParams.set('_', Date.now());
|
||||||
|
|
||||||
// Grab the data as a Blob
|
// Force network fetch and include same‑origin credentials
|
||||||
|
const response = await fetch(requestUrl.toString(), {
|
||||||
|
credentials: 'same-origin',
|
||||||
|
cache: 'no-store'
|
||||||
|
});
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`Download failed: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Turn the response into a blob, then download it
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
|
const blobUrl = URL.createObjectURL(blob);
|
||||||
|
|
||||||
// Create your own blob: URL and anchor
|
|
||||||
const url = URL.createObjectURL(blob);
|
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = blobUrl;
|
||||||
|
|
||||||
// Retain original filename if possible
|
// Retain original filename if possible
|
||||||
let filename = decodeURIComponent(src.split('/').pop() || 'audio');
|
a.download = decodeURIComponent(src.split('/').pop() || 'audio');
|
||||||
a.download = filename;
|
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(blobUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
const cacheName = 'gottesdienste-v1.3';
|
const cacheName = 'gottesdienste-v1.7';
|
||||||
const assets = [
|
const assets = [
|
||||||
'/',
|
'/',
|
||||||
'/static/app.css',
|
'/static/app.css',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user