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:
Pontoporeia
2026-05-11 10:47:33 +02:00
parent 28ef35dce5
commit 83a5a508ea
18 changed files with 748 additions and 261 deletions

View File

@@ -95,8 +95,23 @@
<?php
$mime = $f['mime_type'] ?? '';
$isImage = str_starts_with($mime, 'image/');
$mediaUrl = '/media?path=' . urlencode($f['file_path']);
$fileName = htmlspecialchars($f['file_name'] ?? basename($f['file_path']));
$filePath = $f['file_path'] ?? '';
$isPeerTube = str_starts_with($filePath, 'peertube_ids:');
if ($isPeerTube) {
$_ptUuid = substr($filePath, strlen('peertube_ids:'));
require_once APP_ROOT . '/src/PeerTubeService.php';
$_ptDb = new Database();
$_ptS = PeerTubeService::getSettings($_ptDb);
// Only link to watch page for public (1) and unlisted (2) videos
if ((int)$_ptS['privacy'] <= 2) {
$mediaUrl = PeerTubeService::getWatchUrl($_ptDb, $_ptUuid);
} else {
$mediaUrl = '#';
}
} else {
$mediaUrl = '/media?path=' . urlencode($filePath);
}
$fileName = htmlspecialchars($f['file_name'] ?? basename($filePath));
$fileType = htmlspecialchars($f['file_type']);
?>
<li class="recap-file-item">
@@ -107,7 +122,9 @@
<?php else: ?>
<span class="recap-file-icon">
<?php
if ($mime === 'application/pdf') echo '📄';
if ($isPeerTube && $f['file_type'] === 'video') echo '🎬';
elseif ($isPeerTube && $f['file_type'] === 'audio') echo '🎵';
elseif ($mime === 'application/pdf') echo '📄';
elseif (str_starts_with($mime, 'video/')) echo '🎬';
elseif (str_starts_with($mime, 'audio/')) echo '🎵';
elseif (in_array($mime, ['application/zip','application/x-zip-compressed'])) echo '🗜️';