Actualiser api.php

This commit is contained in:
2026-07-01 14:46:01 +02:00
parent 99f0c235c8
commit 0f92be5434
+13 -5
View File
@@ -164,11 +164,19 @@ function parseDiscCountFromTitle($title) {
}
function cleanUpcTitle($title) {
$clean = trim($title);
$clean = preg_replace('/^[\s"]*(DVD|Blu-ray|Blu Ray|4K|UHD)[\s"]*/i', '', $clean);
$clean = preg_replace('/(blu-ray|bluray|dvd|4k|ultra hd|combo|vhs|blister pack|new blister).*$/i', '', $clean);
$clean = preg_replace('/[\s"]+New[\s"]*$/i', '', $clean);
return cleanTitle($clean);
// Recherche la position du premier guillemet (")
$firstQuote = strpos($title, '"');
// Recherche la position du dernier guillemet (")
$lastQuote = strrpos($title, '"');
// Si on a trouvé au moins deux guillemets différents
if ($firstQuote !== false && $lastQuote !== false && $firstQuote !== $lastQuote) {
// On extrait et nettoie ce qu'il y a strictement entre les deux
return trim(substr($title, $firstQuote + 1, $lastQuote - $firstQuote - 1));
}
// Si pas de guillemets trouvés, on retourne le titre original (fallback de sécurité)
return trim($title);
}
function emptyPhysicalResult() {