Actualiser api.php

This commit is contained in:
2026-06-23 16:27:52 +02:00
parent 5b2fd5685e
commit 02676f49f5
+16 -10
View File
@@ -322,10 +322,11 @@ switch ($action) {
$result['format'] = $upcData['format']; $result['format'] = $upcData['format'];
} }
// 🔥 NOUVEAU : DVDFr pour remplacer l'affiche lors d'un ajout manuel // 🔥 NOUVEAU : DVDFr pour remplacer l'affiche ET le synopsis lors d'un ajout manuel
$dvdfrCover = fetchDVDFr($ean, $pdo); $dvdfrData = fetchDVDFr($ean, $pdo);
if (!empty($dvdfrCover)) { if (!empty($dvdfrData)) {
$result['poster'] = $dvdfrCover; if (!empty($dvdfrData['poster'])) $result['poster'] = $dvdfrData['poster'];
if (!empty($dvdfrData['synopsis'])) $result['description'] = $dvdfrData['synopsis'];
} }
$tmdbKey = getTmdbApiKey($pdo); $tmdbKey = getTmdbApiKey($pdo);
if ($tmdbKey && $tmdbQueryTitle) { if ($tmdbKey && $tmdbQueryTitle) {
@@ -442,10 +443,15 @@ switch ($action) {
if (empty($format) || $format === 'Blu-ray') $format = $upcData['format']; if (empty($format) || $format === 'Blu-ray') $format = $upcData['format'];
} }
// 🔥 NOUVEAU : 1.5 DVDFr (Écrase l'affiche UPC avec la vraie jaquette FR) // 🔥 NOUVEAU : 1.5 DVDFr (Jaquette FR et Synopsis)
$dvdfrCover = fetchDVDFr($ean, $pdo); $dvdfrData = fetchDVDFr($ean, $pdo);
if (!empty($dvdfrCover)) { if (!empty($dvdfrData)) {
$poster = $dvdfrCover; if (!empty($dvdfrData['poster'])) {
$poster = $dvdfrData['poster'];
}
if (!empty($dvdfrData['synopsis'])) {
$description = $dvdfrData['synopsis']; // Injecte le résumé du DVD/Coffret
}
} }
} }
@@ -468,8 +474,8 @@ switch ($action) {
// 👇 LIGNE DÉSACTIVÉE ICI UNIQUEMENT POUR LA VIDÉOTHÈQUE 👇 // 👇 LIGNE DÉSACTIVÉE ICI UNIQUEMENT POUR LA VIDÉOTHÈQUE 👇
// if (empty($poster) && !empty($tmdbData['poster'])) $poster = $tmdbData['poster']; // if (empty($poster) && !empty($tmdbData['poster'])) $poster = $tmdbData['poster'];
// 🔥 Récupération du Synopsis officiel // 🔥 Récupération du Synopsis officiel (Seulement si DVDFr n'a rien trouvé)
if (!empty($tmdbData['overview'])) { if (empty($description) && !empty($tmdbData['overview'])) {
$description = $tmdbData['overview']; $description = $tmdbData['overview'];
} }
// 🔥 Récupération des Acteurs officiels (Top 4) // 🔥 Récupération des Acteurs officiels (Top 4)