fix: supprimer les vidéos PeerTube lors de la suppression d'un TFE

- Ajout de PeerTubeService::deleteVideo() qui appelle DELETE /api/v1/videos/{uuid}
- deleteThesisFileToTrash() appelle maintenant deleteVideo() pour les fichiers peertube_ids:
- hardDeleteThesis() supprime aussi les vidéos PeerTube associées
This commit is contained in:
Pontoporeia
2026-06-10 00:16:22 +02:00
parent 312d9eab0e
commit a2092b58a7
4 changed files with 54 additions and 10 deletions
+10 -1
View File
@@ -2351,7 +2351,16 @@ class Database
$storageRoot = defined('STORAGE_ROOT') ? STORAGE_ROOT : '/var/www/xamxam/storage';
foreach ($files as $file) {
$fp = $file['file_path'] ?? '';
if ($fp === '' || str_starts_with($fp, 'http://') || str_starts_with($fp, 'https://') || str_starts_with($fp, 'peertube_ids:')) {
if ($fp === '') {
continue;
}
if (str_starts_with($fp, 'http://') || str_starts_with($fp, 'https://')) {
continue;
}
if (str_starts_with($fp, 'peertube_ids:')) {
$uuid = substr($fp, strlen('peertube_ids:'));
require_once __DIR__ . '/PeerTubeService.php';
PeerTubeService::deleteVideo($this, $uuid);
continue;
}
$abs = $storageRoot . '/' . $fp;