Actualiser api.php
This commit is contained in:
@@ -312,7 +312,7 @@ switch ($action) {
|
|||||||
'poster' => '', 'publisher' => '', 'format' => '',
|
'poster' => '', 'publisher' => '', 'format' => '',
|
||||||
'length' => '', 'number_of_discs' => 1, 'aspect_ratio' => '', 'actors' => ''
|
'length' => '', 'number_of_discs' => 1, 'aspect_ratio' => '', 'actors' => ''
|
||||||
];
|
];
|
||||||
$upcData = fetchUPCitemdb($ean, $pdo);
|
$upcData = fetchUPCitemdb($ean, $pdo);
|
||||||
$tmdbQueryTitle = "";
|
$tmdbQueryTitle = "";
|
||||||
if ($upcData) {
|
if ($upcData) {
|
||||||
$tmdbQueryTitle = $upcData['title'];
|
$tmdbQueryTitle = $upcData['title'];
|
||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user