mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
feat: PeerTube integration — alternate audio/video labels, FilePond pools, shared SMTP credentials, channel by name, test button, resumable upload, embed improvements, fix alt labels/curl_close/deprecation
This commit is contained in:
@@ -33,8 +33,16 @@
|
||||
"text/vtt",
|
||||
"application/zip", "application/x-tar", "application/gzip"
|
||||
],
|
||||
// When PeerTube is active, exclude video/audio from TFE pool
|
||||
acceptedFileTypesPeerTube: [
|
||||
"image/jpeg", "image/png", "image/gif", "image/webp",
|
||||
"application/pdf",
|
||||
"text/vtt",
|
||||
"application/zip", "application/x-tar", "application/gzip"
|
||||
],
|
||||
labelFileTypeNotAllowed: "Format non accepté",
|
||||
fileValidateTypeLabelExpectedTypes: "PDF, Images, Vidéos, Audio, VTT, Archives",
|
||||
fileValidateTypeLabelExpectedTypesPeerTube: "PDF, Images, VTT, Archives",
|
||||
maxFileSize: "500MB",
|
||||
labelMaxFileSizeExceeded: "Fichier trop volumineux",
|
||||
labelMaxFileSize: "Taille max: {filesize}",
|
||||
@@ -91,17 +99,37 @@
|
||||
labelMaxFileSize: "Taille max: {filesize}",
|
||||
allowMultiple: false
|
||||
},
|
||||
peertube_video: {
|
||||
acceptedFileTypes: ["video/mp4", "video/webm", "video/ogg", "video/quicktime"],
|
||||
labelFileTypeNotAllowed: "Format non accepté",
|
||||
fileValidateTypeLabelExpectedTypes: "MP4, WebM, OGV, MOV",
|
||||
maxFileSize: "500MB",
|
||||
labelMaxFileSizeExceeded: "Fichier trop volumineux",
|
||||
labelMaxFileSize: "Taille max: {filesize}",
|
||||
allowMultiple: true
|
||||
},
|
||||
peertube_audio: {
|
||||
acceptedFileTypes: ["audio/mpeg", "audio/ogg", "audio/flac", "audio/x-wav", "audio/aac", "audio/mp4"],
|
||||
labelFileTypeNotAllowed: "Format non accepté",
|
||||
fileValidateTypeLabelExpectedTypes: "MP3, OGG, FLAC, WAV, AAC, M4A",
|
||||
maxFileSize: "500MB",
|
||||
labelMaxFileSizeExceeded: "Fichier trop volumineux",
|
||||
labelMaxFileSize: "Taille max: {filesize}",
|
||||
allowMultiple: true
|
||||
},
|
||||
};
|
||||
|
||||
// Map input id → queue type
|
||||
var INPUT_ID_TO_TYPE = {
|
||||
"tfe-files-input": "tfe",
|
||||
"tfe-files-input-2": "tfe",
|
||||
"video-files-input": "video",
|
||||
"audio-files-input": "audio",
|
||||
"annexe-files-input": "annexe",
|
||||
"couverture": "cover",
|
||||
"note_intention": "note_intention",
|
||||
"tfe-files-input": "tfe",
|
||||
"tfe-files-input-2": "tfe",
|
||||
"video-files-input": "video",
|
||||
"audio-files-input": "audio",
|
||||
"annexe-files-input": "annexe",
|
||||
"couverture": "cover",
|
||||
"note_intention": "note_intention",
|
||||
"peertube-video-input": "peertube_video",
|
||||
"peertube-audio-input": "peertube_audio",
|
||||
};
|
||||
|
||||
// ── Helpers ───────────────────────────────────────────────────────────
|
||||
@@ -167,6 +195,15 @@
|
||||
// Per-type max size overrides (for TFE: PDF=100MB, video/audio=2GB)
|
||||
var perExtMax = cfg.perExtensionMaxSize || {};
|
||||
|
||||
// When PeerTube is active, restrict TFE pool to PDF/text only
|
||||
var peerTubeActive = queueType === "tfe" && input.dataset.peertubeActive === "1";
|
||||
var acceptedFileTypes = peerTubeActive && cfg.acceptedFileTypesPeerTube
|
||||
? cfg.acceptedFileTypesPeerTube
|
||||
: cfg.acceptedFileTypes;
|
||||
var expectedTypesLabel = peerTubeActive && cfg.fileValidateTypeLabelExpectedTypesPeerTube
|
||||
? cfg.fileValidateTypeLabelExpectedTypesPeerTube
|
||||
: cfg.fileValidateTypeLabelExpectedTypes;
|
||||
|
||||
return {
|
||||
allowMultiple: cfg.allowMultiple,
|
||||
allowReorder: true,
|
||||
@@ -174,9 +211,9 @@
|
||||
storeAsFile: true,
|
||||
|
||||
// ── Native FilePond validation ──
|
||||
acceptedFileTypes: cfg.acceptedFileTypes,
|
||||
acceptedFileTypes: acceptedFileTypes,
|
||||
labelFileTypeNotAllowed: cfg.labelFileTypeNotAllowed,
|
||||
fileValidateTypeLabelExpectedTypes: cfg.fileValidateTypeLabelExpectedTypes,
|
||||
fileValidateTypeLabelExpectedTypes: expectedTypesLabel,
|
||||
maxFileSize: cfg.maxFileSize,
|
||||
labelMaxFileSizeExceeded: cfg.labelMaxFileSizeExceeded,
|
||||
labelMaxFileSize: cfg.labelMaxFileSize,
|
||||
|
||||
Reference in New Issue
Block a user