diff --git a/api.php b/api.php index 3062638..9feb131 100644 --- a/api.php +++ b/api.php @@ -118,6 +118,10 @@ function emptyPhysicalResult() { ]; } +function makeStableId($type, $title, $year) { + return (abs(crc32(strtolower(trim($type ?? '')) . '|' . strtolower(trim($title ?? '')) . '|' . trim($year ?? ''))) % 2000000000) + 100000000; +} + // ── FONCTIONS API PHYSIQUE (UPCitemdb → UPCMDB fallback) ── function throttleUpcLookup() { static $last = 0; @@ -516,8 +520,7 @@ function fetchFromBlurayCom($ean) { return $empty; } -// ── FONCTION POUR RÉCUPÉRER LES DONNÉES DEPUIS MOVIECOVERS.COM ── -function fetchFromMovieCovers($title) { +function fetchFromMovieCovers($title, $year = '') { $empty = [ 'title' => '', 'year' => '', 'director' => '', 'actors' => '', 'poster' => '', 'description' => '', 'length' => '',