Small changes in Books and Categorize classes

This commit is contained in:
DariusIII
2017-04-03 12:22:48 +02:00
parent 327f622065
commit b046b4d63b
3 changed files with 9 additions and 6 deletions
+1
View File
@@ -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
+7 -5
View File
@@ -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;
}
}
+1 -1
View File
@@ -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;
}