diff --git a/admin.php b/admin.php index e73d906..bee1159 100644 --- a/admin.php +++ b/admin.php @@ -264,7 +264,7 @@ function write_article_id($dir, $id){ $idFile = rtrim((string)$dir, '/').'/'.ARTICLE_ID_FILE; $tmp = $idFile . '.tmp.' . bin2hex(random_bytes(4)); if (file_put_contents($tmp, $id . "\n", LOCK_EX) === false) throw new RuntimeException('Cannot write article id.'); - chmod($tmp, 0664); + @chmod($tmp, 0664); if (!rename($tmp, $idFile)) { @unlink($tmp); throw new RuntimeException('Cannot save article id.'); } } function ensure_article_id($dir, &$seenIds = null){ @@ -734,7 +734,7 @@ function input_dir_running($dir){ function input_dir_enabled($dir){ return is_file($dir . '/.movmaker-enabled'); } function set_input_dir_enabled($dir, $enabled){ $path = $dir . '/.movmaker-enabled'; - if ($enabled) { file_put_contents($path, "enabled\n"); chmod($path, 0664); } + if ($enabled) { file_put_contents($path, "enabled\n"); @chmod($path, 0664); } elseif (is_file($path)) unlink($path); } function input_dir_preview($dir){ @@ -746,7 +746,7 @@ function input_dir_preview($dir){ } function set_input_dir_preview($dir, $preview){ $path = $dir . '/.movmaker-preview'; - if ($preview) { file_put_contents($path, "preview\n"); chmod($path, 0664); } + if ($preview) { file_put_contents($path, "preview\n"); @chmod($path, 0664); } elseif (is_file($path)) unlink($path); $stateFile = $dir . '/.movmaker-state.json'; $state = is_file($stateFile) ? json_decode((string)file_get_contents($stateFile), true) : []; @@ -755,18 +755,18 @@ function set_input_dir_preview($dir, $preview){ $state['preview'] = (bool)$preview; $state['preview_updated_at'] = gmdate('c'); file_put_contents($stateFile, json_encode($state, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) . "\n"); - chmod($stateFile, 0664); + @chmod($stateFile, 0664); } function input_dir_visible($dir){ return !is_file($dir . '/.mvlog-hidden'); } function set_input_dir_visible($dir, $visible){ $path = $dir . '/.mvlog-hidden'; if ($visible) { if (is_file($path)) unlink($path); } - else { file_put_contents($path, "hidden\n"); chmod($path, 0664); } + else { file_put_contents($path, "hidden\n"); @chmod($path, 0664); } } function input_dir_map_hidden($dir){ return is_file($dir . '/' . MAP_HIDDEN_FILE); } function set_input_dir_map_hidden($dir, $hidden){ $path = $dir . '/' . MAP_HIDDEN_FILE; - if ($hidden) { file_put_contents($path, "hide-map\n"); chmod($path, 0664); } + if ($hidden) { file_put_contents($path, "hide-map\n"); @chmod($path, 0664); } elseif (is_file($path)) unlink($path); } function is_image_media_file($name){ @@ -814,7 +814,7 @@ function ensure_state_article_id($dir){ if (($state['article_id'] ?? '') !== $articleId) { $state['article_id'] = $articleId; file_put_contents($stateFile, json_encode($state, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) . "\n"); - chmod($stateFile, 0664); + @chmod($stateFile, 0664); } return $articleId; } @@ -958,7 +958,7 @@ try { $tmpSlug = '.upload-' . date('YmdHis') . '-' . bin2hex(random_bytes(4)); $tmpDir = $config['uploads_dir'] . '/' . $tmpSlug; if (!mkdir($tmpDir, 0775, true)) throw new RuntimeException('Cannot create temporary input directory.'); - chmod($tmpDir, 02775); + @chmod($tmpDir, 02775); $media = save_uploads('media', $tmpDir, $allowedMedia); if (!$media) { rrmdir($tmpDir); throw new RuntimeException('Upload at least one image or video.'); } save_uploads('audio', $tmpDir, $allowedAudio); @@ -967,7 +967,7 @@ try { $dir = unique_input_dir($config['uploads_dir'], $slug); $slug = basename($dir); if (!rename($tmpDir, $dir)) { rrmdir($tmpDir); throw new RuntimeException('Cannot create input directory.'); } - chmod($dir, 02775); + @chmod($dir, 02775); $articleId = ensure_article_id($dir); write_data($dir, $_POST); set_input_dir_enabled($dir, false); @@ -1356,8 +1356,8 @@ $runningJobs = active_worker_jobs($config);
RenderingEdit

No videoPreview video

· files

Edit input dir

in-dir/

This input directory is . Editing is disabled until the job completes.
-

Edit input dir

in-dir/

Files and captions

No caption for audio files
-

Add new movie input

+

Edit input dir

in-dir/

Files and captions

No caption for audio files
+

Add new movie input