mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Add function to match poster for categorization
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<nntmux>
|
||||
<versions>
|
||||
<git>
|
||||
<tag>v0.4.2</tag>
|
||||
<tag>0.0.0</tag>
|
||||
<!-- commit count removed -->
|
||||
<hooks>
|
||||
<precommit>9</precommit>
|
||||
|
||||
+17
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user