Added personality - Chamberlain
This commit is contained in:
parent
be70760320
commit
3d996db3b2
4 changed files with 75 additions and 13 deletions
|
|
@ -11,6 +11,8 @@ $id = strtolower(trim((string)($_POST['id'] ?? '')));
|
|||
$job = trim((string)($_POST['job'] ?? ''));
|
||||
$max_frames = isset($_POST['max_frames']) ? intval($_POST['max_frames']) : 16;
|
||||
$additional_prompt = trim((string)($_POST['additional_prompt'] ?? ''));
|
||||
$personality = strtolower(trim((string)($_POST['personality'] ?? 'auto')));
|
||||
if (!preg_match('/^[a-z0-9_-]+$/', $personality)) $personality = 'auto';
|
||||
|
||||
function mvlog_article_id_is_valid(string $id): bool {
|
||||
return (bool)preg_match('/^[0-9]{14}[a-f0-9]{16}$/', $id);
|
||||
|
|
@ -110,12 +112,9 @@ if (!is_file($script)) {
|
|||
exit;
|
||||
}
|
||||
|
||||
// Build command and execute. Pass optional additional prompt as the last argument.
|
||||
if ($additional_prompt !== '') {
|
||||
$cmd = escapeshellcmd($script) . ' ' . escapeshellarg($jobdir) . ' ' . escapeshellarg($title) . ' ' . escapeshellarg($location) . ' ' . escapeshellarg((string)$max_frames) . ' ' . escapeshellarg($additional_prompt) . ' 2>&1';
|
||||
} else {
|
||||
$cmd = escapeshellcmd($script) . ' ' . escapeshellarg($jobdir) . ' ' . escapeshellarg($title) . ' ' . escapeshellarg($location) . ' ' . escapeshellarg((string)$max_frames) . ' ' . escapeshellarg('no-append') . ' 2>&1';
|
||||
}
|
||||
// Build command and execute. Pass optional additional prompt and chosen personality.
|
||||
$prompt_arg = $additional_prompt !== '' ? $additional_prompt : 'no-append';
|
||||
$cmd = escapeshellcmd($script) . ' ' . escapeshellarg($jobdir) . ' ' . escapeshellarg($title) . ' ' . escapeshellarg($location) . ' ' . escapeshellarg((string)$max_frames) . ' ' . escapeshellarg($prompt_arg) . ' ' . escapeshellarg($personality) . ' 2>&1';
|
||||
|
||||
// Allow long-running
|
||||
@set_time_limit(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue