From db37681907b7f4a86a5332152d3884d00a97831e Mon Sep 17 00:00:00 2001 From: DariusIII Date: Thu, 13 Dec 2018 10:14:14 +0100 Subject: [PATCH] Increase percentage for matching in matchPreDbFiles function --- Blacklight/NameFixer.php | 6 +++--- Changelog | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index 3bd3ce9ea..fe9c8642a 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -1282,7 +1282,7 @@ class NameFixer $preFtMatch = $this->preMatch($result['filename']); if ($preFtMatch[0] === true) { similar_text($preMatch[1], $preFtMatch[1], $percent); - if ($percent >= 93) { + if ($percent >= 97) { $this->_fileName = $result['filename']; $release->filename = $this->_fileName; if ($result['title'] !== $release->searchname) { @@ -1315,7 +1315,7 @@ class NameFixer // first strip all non-printing chars from filename $this->_fileName = Utility::stripNonPrintingChars($this->_fileName); - if (\strlen($this->_fileName) > 0 && strpos($this->_fileName, '.') !== 0) { + if ($this->_fileName !== '' && strpos($this->_fileName, '.') !== 0) { switch (true) { case strpos($this->_fileName, '.') !== false: @@ -2431,7 +2431,7 @@ class NameFixer */ private function preMatch($fileName): array { - $result = preg_match('/(\d{2}\.\d{2}\.\d{2})+[\w\-.]+[\w]$/i', $fileName, $match); + $result = preg_match('/(\d{2}\.\d{2}\.\d{2})+([\w\-.]+[\w]$)/i', $fileName, $match); return [$result === 1, $match[0] ?? '']; } diff --git a/Changelog b/Changelog index c1c2cc816..ae22843aa 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2018-12-13 DariusIII + * Chg: Increase percentage for matching in matchPreDbFiles function 2018-12-12 DariusIII * Chg: Prevent query error on empty movie page (when no movies have been added yet) * Fix: Fix couple of issues introduced with API changes