From f8c8fa2c4d34f7450db55a59c5d0f892879cf1fa Mon Sep 17 00:00:00 2001 From: hbrain Date: Mon, 15 Jun 2026 05:26:42 +0200 Subject: [PATCH] Add describe prompt field to edit form --- admin.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/admin.php b/admin.php index cf07b7f..0f52987 100644 --- a/admin.php +++ b/admin.php @@ -365,6 +365,20 @@ function resolve_input_dir_from_request($base, $id, $dir, $articleIndex = null){ } return resolve_input_dir($base, $dir, $articleIndex); } +function read_describe_prompt($dir){ + $file = rtrim((string)$dir, '/') . '/.mvlog-describe-prompt.txt'; + return is_file($file) ? trim((string)@file_get_contents($file)) : ''; +} +function write_describe_prompt($dir, $text){ + $file = rtrim((string)$dir, '/') . '/.mvlog-describe-prompt.txt'; + $text = trim((string)$text); + if ($text === '') { + if (is_file($file)) @unlink($file); + return; + } + file_put_contents($file, $text . PHP_EOL); + @chmod($file, 0664); +} function read_data($dir){ $data = ['title'=>'','teaser'=>'','quote_da'=>'','date'=>'','place'=>'','description'=>'','captions'=>[],'video_audio'=>[]]; $file = $dir . '/data.txt'; if (!is_file($file)) return $data; @@ -476,6 +490,7 @@ function infer_date_from_first_media($dir){ return ''; } function write_data($dir, $post){ + if (array_key_exists('describe_prompt', $post)) write_describe_prompt($dir, $post['describe_prompt']); $title = trim($post['title'] ?? ''); $teaser = trim($post['teaser'] ?? ''); $quote_da = trim($post['quote_da'] ?? ''); @@ -1543,7 +1558,7 @@ $runningJobs = active_worker_jobs($config);
RenderingEditEdit

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
+

Edit input dir

in-dir/

Files and captions

No caption for audio files

Add new movie input