fix mail e converted video flag
This commit is contained in:
@@ -75,6 +75,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
unlink($upload_path);
|
||||
$file_name = pathinfo($file_name, PATHINFO_FILENAME) . '.mp4';
|
||||
$upload_path = $converted_path;
|
||||
$video_converted = true;
|
||||
}
|
||||
// Se la conversione fallisce, usa comunque il file originale
|
||||
}
|
||||
@@ -83,6 +84,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
// Imposta il percorso relativo per il database (senza slash iniziale)
|
||||
$video_url = 'uploads/lessons/' . ($is_demo ? 'demo' : 'pay') . '/' . $file_name;
|
||||
|
||||
// Se è già MP4, considera già convertito
|
||||
if ($file_extension === 'mp4') {
|
||||
$video_converted = true;
|
||||
}
|
||||
|
||||
// Estrai durata automaticamente se non specificata
|
||||
if (empty($duration)) {
|
||||
$duration = get_video_duration($upload_path);
|
||||
@@ -111,9 +117,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
title, description, type, video_url, video_platform,
|
||||
duration, live_platform, live_url, live_date,
|
||||
level, category, price, is_demo, is_active,
|
||||
created_by, created_at
|
||||
video_converted, created_by, created_at
|
||||
) VALUES (
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW()
|
||||
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW()
|
||||
)
|
||||
");
|
||||
|
||||
@@ -132,6 +138,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$price,
|
||||
$is_demo,
|
||||
$is_active,
|
||||
$video_converted ?? false,
|
||||
$_SESSION['user_id']
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user