33 lines
933 B
PHP
33 lines
933 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$src_dir = "/var/www/html/api/ambre-pw-tests/output";
|
|
$dest_dir = "/var/www/html/generated";
|
|
if (!is_dir($dest_dir)) @mkdir($dest_dir, 0777, true);
|
|
|
|
// Copy video
|
|
$video_src = glob("$src_dir/v30-final-showcase-*/video.webm")[0] ?? null;
|
|
$out = [];
|
|
|
|
if ($video_src) {
|
|
$dest = "$dest_dir/wevia-v30-showcase-" . date("Ymd-His") . ".webm";
|
|
@copy($video_src, $dest);
|
|
@chmod($dest, 0644);
|
|
$out["video"] = [
|
|
"url" => "/generated/" . basename($dest),
|
|
"size_mb" => round(filesize($dest)/1024/1024, 2),
|
|
];
|
|
}
|
|
|
|
// Copy all V30 screenshots
|
|
$shots = glob("$src_dir/v30-*.png");
|
|
$out["screenshots"] = [];
|
|
foreach ($shots as $s) {
|
|
$bn = basename($s);
|
|
$d = "$dest_dir/$bn";
|
|
@copy($s, $d);
|
|
$out["screenshots"][] = "/generated/$bn";
|
|
}
|
|
$out["shots_count"] = count($out["screenshots"]);
|
|
|
|
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|