Increase percentage for matching in matchPreDbFiles function

This commit is contained in:
DariusIII
2018-12-13 10:14:14 +01:00
parent c2f4932ee6
commit db37681907
2 changed files with 5 additions and 3 deletions
+3 -3
View File
@@ -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] ?? ''];
}
+2
View File
@@ -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