diff --git a/Changelog b/Changelog index 9c15179c6..4ba4c3678 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2016-07-20 DariusIII + * Chg: Add function to match poster for categorization * Chg: Update upcoming pages to prevent notices when alternate_ids is not set in rottentomatoes response * Chg: Update XXX UHD and XXX HD regexes for categorization 2016-07-19 DariusIII diff --git a/build/nntmux.xml b/build/nntmux.xml index 16a6cd2a8..66cea5f43 100755 --- a/build/nntmux.xml +++ b/build/nntmux.xml @@ -2,7 +2,7 @@ - v0.4.2 + 0.0.0 9 diff --git a/nntmux/Categorize.php b/nntmux/Categorize.php index 162df8a3c..85678f5eb 100644 --- a/nntmux/Categorize.php +++ b/nntmux/Categorize.php @@ -1022,8 +1022,7 @@ class Categorize extends Category public function isXxxClipSD() { - if (preg_match('/oz@lot[.]com/i', $this->poster)) { - $this->tmpCat = Category::XXX_CLIPSD; + if ($this->checkPoster( '/oz@lot[.]com/i', $this->poster, Category::XXX_CLIPSD) === true) { return true; } return false; @@ -1489,4 +1488,20 @@ class Categorize extends Category } return true; } + + /** + * @param string $regex Regex to use for match + * @param string $fromName Poster that needs to be matched by regex + * @param string $category Category to set if there is a match + * + * @return bool + */ + public function checkPoster($regex, $fromName, $category) + { + if (preg_match($regex, $fromName)) { + $this->tmpCat = $category; + return true; + } + return false; + } }