mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-09-25 01:53:03 +02:00
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:
+10
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user