diff --git a/new.php b/new.php index 570fb3f..04da8e8 100644 --- a/new.php +++ b/new.php @@ -61,7 +61,7 @@ function save_uploads($field, $dest, $allowed){ } return $saved; } -$msg = $err = null; +$msg = $_GET['msg'] ?? null; $err = null; $allowedMedia = ['jpg','jpeg','png','webp','gif','mp4','mov','m4v','avi','mkv','webm']; $allowedAudio = ['mp3','wav','m4a','aac','ogg','flac']; try { @@ -95,7 +95,19 @@ try { $_GET['edit'] = basename($dir); } elseif ($action === 'delete_dir') { $dir = safe_input_dir($config['uploads_dir'], $_POST['dir'] ?? ''); - $name = basename($dir); rrmdir($dir); $msg = 'Deleted input directory: in-dir/' . $name; + $name = basename($dir); + $stateFile = $dir . '/.movmaker-state.json'; + $state = is_file($stateFile) ? json_decode((string)file_get_contents($stateFile), true) : []; + $output = is_array($state) ? basename((string)($state['output'] ?? '')) : ''; + if (!empty($_POST['delete_output']) && $output !== '') { + $outPath = $config['videos_dir'] . '/' . $output; + if (is_file($outPath)) unlink($outPath); + $cache = __DIR__ . '/cache/videos.json'; + if (is_file($cache)) unlink($cache); + } + rrmdir($dir); + header('Location: new.php?msg=' . rawurlencode('Deleted input directory: in-dir/' . $name)); + exit; } } } catch (Throwable $e) { $err = $e->getMessage(); } @@ -108,6 +120,6 @@ if ($editName !== '') { try { $editDir = safe_input_dir($config['uploads_dir'],

MVLog Admin

Existing input dirs

No input directories yet.


ยท files
Edit
-

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