From 54e9dd8d6f28359efdbf856475492a9660ff8e44 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 21 Jan 2020 15:56:50 +0100 Subject: [PATCH] Update AudioBook categorization --- Blacklight/Categorize.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Blacklight/Categorize.php b/Blacklight/Categorize.php index 6d71129af..dd7d76185 100755 --- a/Blacklight/Categorize.php +++ b/Blacklight/Categorize.php @@ -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; }