From b046b4d63bc74d1b8955cbecdf6b8f2877ebc200 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 3 Apr 2017 12:22:48 +0200 Subject: [PATCH] Small changes in Books and Categorize classes --- Changelog | 1 + nntmux/Books.php | 12 +++++++----- nntmux/Categorize.php | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Changelog b/Changelog index 5e635d589..37336300f 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2017-04-03 DariusIII + * Chg: Small changes in Books and Categorize classes * Chg: Update used unserialize function to match PHP7 usage in IRCScraper class 2017-03-30 DariusIII * Chg: Update AniDB related classes and scripts diff --git a/nntmux/Books.php b/nntmux/Books.php index 1acbc9164..403069c9e 100755 --- a/nntmux/Books.php +++ b/nntmux/Books.php @@ -317,9 +317,12 @@ class Books ); } + /** + * @return array + */ public function getBrowseByOptions() { - return array('author' => 'author', 'title' => 'title'); + return ['author' => 'author', 'title' => 'title']; } public function getBrowseBy() @@ -492,7 +495,7 @@ class Books $releasename = trim(preg_replace('/\s\s+/i', ' ', $d)); // the default existing type was ebook, this handles that in the same manor as before - if ($releasetype == 'ebook') { + if ($releasetype === 'ebook') { if (preg_match('/^([a-z0-9] )+$|ArtofUsenet|ekiosk|(ebook|mobi).+collection|erotica|Full Video|ImwithJamie|linkoff org|Mega.+pack|^[a-z0-9]+ (?!((January|February|March|April|May|June|July|August|September|O(c|k)tober|November|De(c|z)ember)))[a-z]+( (ebooks?|The))?$|NY Times|(Book|Massive) Dump|Sexual/i', $releasename)) { if ($this->echooutput) { @@ -516,13 +519,12 @@ class Books } else { return false; } - } else if ($releasetype == 'audiobook') { + } else if ($releasetype === 'audiobook') { if (!empty($releasename) && !preg_match('/^[a-z0-9]+$|^([0-9]+ ){1,}$|Part \d+/i', $releasename)) { // we can skip category for audiobooks, since we already know it, so as long as the release name is valid return it so that it is postprocessed by amazon. In the future, determining the type of audiobook could be added (Lecture or book), since we can skip lookups on lectures, but for now handle them all the same way return $releasename; - } else { - return false; } + return false; } } diff --git a/nntmux/Categorize.php b/nntmux/Categorize.php index 77d7b959f..e7e16988d 100755 --- a/nntmux/Categorize.php +++ b/nntmux/Categorize.php @@ -951,7 +951,7 @@ class Categorize extends Category public function isXxx264() { - if (preg_match('/720p|1080(hd|[ip])|[xh][^a-z0-9]?264/i', $this->releaseName) && !preg_match('/\bwmv\b/i', $this->releaseName) && !preg_match('/SDX264XXX/i', $this->releaseName)) { + if (preg_match('/720p|1080(hd|[ip])|[xh][^a-z0-9]?264/i', $this->releaseName) && !preg_match('/\bwmv\b/i', $this->releaseName) && stripos($this->releaseName, 'SDX264XXX') === false) { $this->tmpCat = Category::XXX_X264; return true; }