Update Saqel Platform: 2026-09-10 12:26:22

This commit is contained in:
Hamza-Ayed
2026-09-10 12:32:01 +03:00
parent 09dfd665b5
commit 960d4c8604
28 changed files with 690 additions and 2864 deletions
+9 -1
View File
@@ -327,6 +327,9 @@ class VideoController
);
$auditId = $this->recordUploadAudit($request, $courseId, $_FILES['video'], $preflight);
if (($preflight['decision'] ?? '') !== 'approved') {
// The candidate contains no accepted media yet, so make it reusable.
// Do not leave a failed local quality gate blocking a future upload.
TeacherSubmissionService::releaseUploadReservation((int)$request->user_id, $videoVersionId);
$response->status(422)->json([
'status' => 'needs_review',
'message' => 'لم يتم حفظ الفيديو في Cloudflare R2 قبل اجتياز تدقيق الجودة.',
@@ -335,6 +338,7 @@ class VideoController
return;
}
$reviewQueued = false;
try {
// Fast direct upload: save file locally and slice HLS instantly via stream copy (-c copy)
$uploadResult = VideoService::handleDirectUpload($_FILES['video'], $courseId, $title, false);
@@ -364,11 +368,12 @@ class VideoController
$lessonId,
hash_file('sha256', (string)$_FILES['video']['tmp_name'])
);
$reviewQueued = true;
// Immediately send HTTP 201 response to Flutter client and close connection
$responsePayload = [
'status' => 'success',
'message' => 'تم رفع الفيديو واعتماده مبدئياً بنجاح. تجري المزامنة السحابية والتحليل السقراطي في الخلفية.',
'message' => 'تم رفع الفيديو إلى طابور المراجعة. لن يظهر للطلاب قبل اكتمال الأدلة وقرار المراجع البشري.',
'data' => array_merge($uploadResult, [
'lesson_id' => $lessonId,
'title' => $title,
@@ -406,6 +411,9 @@ class VideoController
exit;
} catch (\Throwable $e) {
if (!$reviewQueued) {
TeacherSubmissionService::releaseUploadReservation((int)$request->user_id, $videoVersionId);
}
$response->status(500)->json([
'status' => 'error',
'message' => $e->getMessage()