Update getBrowseBy function in XXX class

This commit is contained in:
DariusIII
2018-04-30 11:10:38 +02:00
parent 01c0b25428
commit 680ee77e2d
2 changed files with 11 additions and 19 deletions
+10 -19
View File
@@ -3,7 +3,6 @@
namespace Blacklight;
use App\Models\Genre;
use Blacklight\db\DB;
use App\Models\Release;
use App\Models\XxxInfo;
use App\Models\Category;
@@ -21,10 +20,6 @@ use Blacklight\processing\adult\Hotmovies;
*/
class XXX
{
/**
* @var \Blacklight\db\DB
*/
public $pdo;
/**
* What scraper class did we use -- used for template and trailer information.
@@ -90,8 +85,6 @@ class XXX
'Settings' => null,
];
$options += $defaults;
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
$this->releaseImage = ($options['ReleaseImage'] instanceof ReleaseImage ? $options['ReleaseImage'] : new ReleaseImage());
$this->movieqty = Settings::settingValue('..maxxxxprocessed') !== '' ? (int) Settings::settingValue('..maxxxxprocessed') : 100;
@@ -220,27 +213,25 @@ class XXX
}
/**
* @return string
* @param $query
*
* @return mixed
*/
protected function getBrowseBy(): string
protected function getBrowseBy($query)
{
$browseBy = ' ';
$browseByArr = ['title', 'director', 'actors', 'genre', 'id'];
foreach ($browseByArr as $bb) {
if (isset($_REQUEST[$bb]) && ! empty($_REQUEST[$bb])) {
$bbv = stripslashes($_REQUEST[$bb]);
foreach (['title', 'director', 'actors', 'genre', 'id'] as $bb) {
if (request()->has($bb) && request()->input($bb) !== null) {
$bbv = stripslashes(request()->input($bb));
if ($bb === 'genre') {
$bbv = $this->getGenreID($bbv);
}
if ($bb === 'id') {
$browseBy .= 'AND xxx.'.$bb.'='.$bbv;
} else {
$browseBy .= 'AND xxx.'.$bb.' '.$this->pdo->likeString($bbv, true, true);
return $query->where('xxx.'.$bb, '=', $bbv);
}
return $query->where('xxx.'.$bb, 'LIKE', '%'.$bbv.'%');
}
}
return $browseBy;
}
/**
+1
View File
@@ -1,4 +1,5 @@
2018-04-30 DariusIII
* Chg: Update getBrowseBy function in XXX class
* Fix: Fix XXX ordering
* Fix: Fix column and table names used in Games, Music and XXX get range functions
2018-04-29 DariusIII