Update AudioBook categorization

This commit is contained in:
DariusIII
2020-01-21 15:56:50 +01:00
parent 70ed6fdbcc
commit 54e9dd8d6f
+16
View File
@@ -4,6 +4,7 @@ namespace Blacklight;
use App\Models\Category;
use App\Models\Settings;
use App\Models\UsenetGroup;
/**
* Categorizing of releases by name/group.
@@ -54,6 +55,11 @@ class Categorize
*/
public $groupid;
/**
* @var string
*/
public $groupName;
/**
* Categorize constructor.
*
@@ -82,6 +88,7 @@ class Categorize
$this->releaseName = $releaseName;
$this->groupid = $groupID;
$this->poster = $poster;
$this->groupName = UsenetGroup::whereId($this->groupid)->value('name');
switch (true) {
case $this->isMisc():
@@ -1244,6 +1251,15 @@ class Categorize
return true;
}
if (preg_match('/audiobook/', $this->groupName)) {
if ($this->categorizeForeign && $this->isMusicForeign()) {
return false;
}
$this->tmpCat = Category::MUSIC_AUDIOBOOK;
$this->tmpTag[] = Category::TAG_MUSIC_AUDIOBOOK;
return true;
}
return false;
}