Actualiser api.php

This commit is contained in:
2026-06-24 09:04:42 +02:00
parent 5d0e631071
commit 2e6820cedc
+2 -2
View File
@@ -368,7 +368,7 @@ switch ($action) {
} else { } else {
$sql = "INSERT INTO videotheque (id, title, year, director, poster, format, length, publisher, ean_isbn13, number_of_discs, aspect_ratio, description, actors) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE title=VALUES(title), year=VALUES(year), director=VALUES(director), poster=VALUES(poster), format=VALUES(format), length=VALUES(length), publisher=VALUES(publisher), ean_isbn13=VALUES(ean_isbn13), number_of_discs=VALUES(number_of_discs), aspect_ratio=VALUES(aspect_ratio), description=VALUES(description), actors=VALUES(actors)"; $sql = "INSERT INTO videotheque (id, title, year, director, poster, format, length, publisher, ean_isbn13, number_of_discs, aspect_ratio, description, actors) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE title=VALUES(title), year=VALUES(year), director=VALUES(director), poster=VALUES(poster), format=VALUES(format), length=VALUES(length), publisher=VALUES(publisher), ean_isbn13=VALUES(ean_isbn13), number_of_discs=VALUES(number_of_discs), aspect_ratio=VALUES(aspect_ratio), description=VALUES(description), actors=VALUES(actors)";
$stmt = $pdo->prepare($sql); $stmt = $pdo->prepare($sql);
$stmt->execute([$id, $data['title'] ?? '', $data['year'] ?? '', $data['director'] ?? '', $data['poster'] ?? '', $data['format'] ?? '', $data['length'] ?? '', $data['publisher'] ?? '', $data['ean_isbn13'] ?? '', $data['number_of_discs'] ?? 1, $data['aspect_ratio'] ?? '', $data['description'] ?? '', $data['actors'] ?? '']); $stmt->execute([$id, $data['title'] ?? '', $data['year'] ?? '', $data['director'] ?? '', $data['poster'] ?? '', $data['format'] ?? '', $data['length'] ?? '', $data['publisher'] ?? '', $data['ean_isbn13'] ?? '', !empty($data['number_of_discs']) ? (int)$data['number_of_discs'] : 1, $data['aspect_ratio'] ?? '', $data['description'] ?? '', $data['actors'] ?? '']);
} }
echo json_encode(["success" => true]); echo json_encode(["success" => true]);
break; break;
@@ -418,7 +418,7 @@ switch ($action) {
$description = $rowData['description'] ?? $rowData['Description'] ?? ''; $description = $rowData['description'] ?? $rowData['Description'] ?? '';
$publisher = $rowData['publisher'] ?? $rowData['Publisher'] ?? ''; $publisher = $rowData['publisher'] ?? $rowData['Publisher'] ?? '';
$length = $rowData['length'] ?? ''; $length = $rowData['length'] ?? '';
$discs = $rowData['number_of_discs'] ?? 1; $discs = !empty($rowData['number_of_discs']) ? (int)$rowData['number_of_discs'] : 1;
$aspect = $rowData['aspect_ratio'] ?? ''; $aspect = $rowData['aspect_ratio'] ?? '';
$format = $rowData['format'] ?? detectFormat($title, $description); $format = $rowData['format'] ?? detectFormat($title, $description);
$poster = $rowData['poster'] ?? ''; $poster = $rowData['poster'] ?? '';