mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
restore
This commit is contained in:
@@ -2846,7 +2846,7 @@ $collections = [
|
||||
]
|
||||
],
|
||||
'videos' => [
|
||||
'$collection' => 'video_renditions',
|
||||
'$collection' => Database::METADATA,
|
||||
'$id' => 'video_renditions',
|
||||
'$name' => 'Video_renditions',
|
||||
'attributes' => [
|
||||
|
||||
@@ -121,6 +121,8 @@ App::post('/v1/projects')
|
||||
if (($collection['$collection'] ?? '') !== Database::METADATA) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$attributes = [];
|
||||
$indexes = [];
|
||||
|
||||
@@ -147,7 +149,7 @@ App::post('/v1/projects')
|
||||
'orders' => $index['orders'],
|
||||
]);
|
||||
}
|
||||
|
||||
var_dump($key);
|
||||
$dbForProject->createCollection($key, $attributes, $indexes);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,35 +125,6 @@ App::post('/v1/storage/buckets')
|
||||
|
||||
$dbForProject->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes);
|
||||
|
||||
$attributes = [];
|
||||
$indexes = [];
|
||||
|
||||
$videos = Config::getParam('collections', [])['videos'] ?? [];
|
||||
|
||||
foreach ($videos['attributes'] as $attribute) {
|
||||
$attributes[] = new Document([
|
||||
'$id' => $attribute['$id'],
|
||||
'type' => $attribute['type'],
|
||||
'size' => $attribute['size'],
|
||||
'required' => $attribute['required'],
|
||||
'signed' => $attribute['signed'],
|
||||
'array' => $attribute['array'],
|
||||
'filters' => $attribute['filters'],
|
||||
'default' => $attribute['default'] ?? null,
|
||||
'format' => $attribute['format'] ?? ''
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($videos['indexes'] as $index) {
|
||||
$indexes[] = new Document([
|
||||
'$id' => $index['$id'],
|
||||
'type' => $index['type'],
|
||||
'attributes' => $index['attributes'],
|
||||
'lengths' => $index['lengths'],
|
||||
'orders' => $index['orders'],
|
||||
]);
|
||||
}
|
||||
$dbForProject->createCollection('bucket_' . $bucket->getInternalId() . '_video_renditions', $attributes, $indexes);
|
||||
} catch (Duplicate $th) {
|
||||
throw new Exception('Bucket already exists', 409, Exception::STORAGE_BUCKET_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ class VideoCustomServerTest extends Scope
|
||||
{
|
||||
|
||||
|
||||
|
||||
// $bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', [
|
||||
// 'content-type' => 'application/json',
|
||||
// 'x-appwrite-project' => $this->getProject()['$id'],
|
||||
@@ -121,7 +122,7 @@ class VideoCustomServerTest extends Scope
|
||||
$key = '1cd0589616c0b0b98dbc42764399799e3dcf0fbcfa0d1f1db2a258573783802267551853ffa77d2895e57597835055afb645237e84d07cffd33f946af6598f40cdfdc11b9eb6bee09fdd0a325a4b5e3ef34fdf4ba745a87dc4de16f9935803c9ff6349f424774b2a4d3c8ce8a40a835b16486dec9e8c1f8fc16bc37e357f9daf';
|
||||
$fid = '62aedd7dcdcc014783ff';
|
||||
$bid = '62aedd7c90a8570ebf31';
|
||||
$stream = 'dash';
|
||||
$stream = 'hls';
|
||||
|
||||
$renditions = $this->client->call(Client::METHOD_GET, '/video/buckets/' . $bid . '/files/' . $stream . '/' . $fid, [
|
||||
'content-type' => 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user