mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
updates
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Auth\Auth;
|
||||
use Appwrite\Event\Delete;
|
||||
use Appwrite\Event\Transcoding;
|
||||
use Appwrite\Utopia\Database\Validator\CustomId;
|
||||
@@ -10,14 +9,12 @@ use Appwrite\Utopia\View;
|
||||
use Utopia\App;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Exception\Duplicate as DuplicateException;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
use Utopia\Database\Validator\UID;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Utopia\Storage\Device;
|
||||
use Utopia\Validator\Boolean;
|
||||
use Utopia\Validator\Numeric;
|
||||
use Utopia\Validator\Range;
|
||||
use Utopia\Validator\Text;
|
||||
use Utopia\Validator\WhiteList;
|
||||
|
||||
+17
-13
@@ -692,19 +692,9 @@ class DeletesV1 extends Worker
|
||||
$videoId = $document->getId();
|
||||
$dbForProject = $this->getProjectDB($projectId);
|
||||
$renditions = $dbForProject->find('videos_renditions', [
|
||||
new Query('videoId', Query::TYPE_EQUAL, [$videoId])]);
|
||||
new Query('videoId', Query::TYPE_EQUAL, [$videoId])
|
||||
]);
|
||||
foreach ($renditions as $rendition) {
|
||||
$subtitles = $dbForProject->find('videos_subtitles', [
|
||||
new Query('videoId', Query::TYPE_EQUAL, [$videoId])]);
|
||||
foreach ($subtitles as $subtitle) {
|
||||
$segments = fn() => $dbForProject->find('videos_subtitles_segments', [
|
||||
new Query('subtitleId', Query::TYPE_EQUAL, [$subtitle->getId()])]);
|
||||
foreach ($segments as $segment) {
|
||||
$dbForProject->deleteDocument('videos_subtitles_segments', $segment->getId());
|
||||
}
|
||||
$dbForProject->deleteDocument('videos_subtitles', $subtitle->getId());
|
||||
}
|
||||
|
||||
$this->deleteByGroup('videos_renditions_segments', [
|
||||
new Query('renditionId', Query::TYPE_EQUAL, [$rendition->getId()])
|
||||
], $dbForProject);
|
||||
@@ -712,8 +702,22 @@ class DeletesV1 extends Worker
|
||||
$dbForProject->deleteDocument('videos_renditions', $rendition->getId());
|
||||
}
|
||||
|
||||
$subtitles = $dbForProject->find('videos_subtitles', [
|
||||
new Query('videoId', Query::TYPE_EQUAL, [$videoId])
|
||||
]);
|
||||
|
||||
foreach ($subtitles as $subtitle) {
|
||||
$segments = $dbForProject->find('videos_subtitles_segments', [
|
||||
new Query('subtitleId', Query::TYPE_EQUAL, [$subtitle->getId()])
|
||||
]);
|
||||
foreach ($segments as $segment) {
|
||||
$dbForProject->deleteDocument('videos_subtitles_segments', $segment->getId());
|
||||
}
|
||||
$dbForProject->deleteDocument('videos_subtitles', $subtitle->getId());
|
||||
}
|
||||
|
||||
$videosDevice = $this->getVideoDevice($projectId);
|
||||
$videosPath = $videosDevice->getPath($videoId);
|
||||
$videosPath = $videosDevice->getPath($videoId);
|
||||
if ($videosDevice->deletePath($videosPath)) {
|
||||
Console::success('Deleted video directory: ' . $videosPath);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user