@quatrain/storage-supabase 1.2.7 → 1.2.8
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.
|
@@ -205,6 +205,7 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
205
205
|
// La variable publicCacheDuration / cacheControl n'est donc pas gérée correctement ici pour le moment.
|
|
206
206
|
// Voir si le SDK de Supabase permet de la supporter dans le futur.
|
|
207
207
|
let download = false;
|
|
208
|
+
const isVideoOrAudio = file.contentType && (file.contentType.startsWith('video/') || file.contentType.startsWith('audio/'));
|
|
208
209
|
if (action === 'download') {
|
|
209
210
|
download = true;
|
|
210
211
|
}
|
|
@@ -220,6 +221,10 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
220
221
|
download = true;
|
|
221
222
|
}
|
|
222
223
|
}
|
|
224
|
+
else if (!isVideoOrAudio) {
|
|
225
|
+
// Default to download=true for non-media files (images, documents) to preserve historical behavior
|
|
226
|
+
download = true;
|
|
227
|
+
}
|
|
223
228
|
const { data, error } = yield this._client
|
|
224
229
|
.from(file.bucket)
|
|
225
230
|
.createSignedUrl(file.ref, expiresIn, { download });
|
package/package.json
CHANGED
|
@@ -215,6 +215,8 @@ export class SupabaseStorageAdapter extends AbstractStorageAdapter {
|
|
|
215
215
|
// Voir si le SDK de Supabase permet de la supporter dans le futur.
|
|
216
216
|
|
|
217
217
|
let download: boolean | string = false
|
|
218
|
+
const isVideoOrAudio = file.contentType && (file.contentType.startsWith('video/') || file.contentType.startsWith('audio/'))
|
|
219
|
+
|
|
218
220
|
if (action === 'download') {
|
|
219
221
|
download = true
|
|
220
222
|
} else if (extra.download !== undefined) {
|
|
@@ -226,6 +228,9 @@ export class SupabaseStorageAdapter extends AbstractStorageAdapter {
|
|
|
226
228
|
} else {
|
|
227
229
|
download = true
|
|
228
230
|
}
|
|
231
|
+
} else if (!isVideoOrAudio) {
|
|
232
|
+
// Default to download=true for non-media files (images, documents) to preserve historical behavior
|
|
233
|
+
download = true
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
const { data, error } = await this._client
|