mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Apply fixes from StyleCI
[ci skip] [skip ci]
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 9306,
|
||||
'index' => 'releases_rt'
|
||||
'index' => 'releases_rt',
|
||||
];
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
require_once dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
|
||||
|
||||
use App\Models\Release;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use nntmux\SphinxSearch;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
if (! isset($argv[1]) || $argv[1] !== 'releases_rt') {
|
||||
exit(
|
||||
@@ -47,7 +47,7 @@ function populate_rt($table, $max)
|
||||
$string = sprintf('REPLACE INTO %s %s VALUES ', $table, $rtvalues);
|
||||
|
||||
$lastId = $minId - 1;
|
||||
echo "[Starting to populate sphinx RT index $table with $total releases.]" . PHP_EOL;
|
||||
echo "[Starting to populate sphinx RT index $table with $total releases.]".PHP_EOL;
|
||||
for ($i = $minId; $i <= ($total + $max + $minId); $i += $max) {
|
||||
$rows = DB::select(sprintf($query, $lastId, $max));
|
||||
DB::commit();
|
||||
|
||||
@@ -1114,9 +1114,8 @@ class NameFixer
|
||||
$join = '';
|
||||
|
||||
if (\strlen($preTitle) >= 15 && preg_match(self::PREDB_REGEX, $preTitle)) {
|
||||
|
||||
$titlematch = SphinxSearch::escapeString($preTitle);
|
||||
$join .= sprintf(
|
||||
$titlematch = SphinxSearch::escapeString($preTitle);
|
||||
$join .= sprintf(
|
||||
'INNER JOIN releases_se rse ON rse.id = r.id
|
||||
WHERE rse.query = "@(name,searchname,filename) %s;mode=extended"',
|
||||
$titlematch
|
||||
|
||||
@@ -738,9 +738,7 @@ class ReleaseRemover
|
||||
if ($this->crapTime === '') {
|
||||
$regexMatch = $this->extractSrchFromRegx($dbRegex);
|
||||
if ($regexMatch !== '') {
|
||||
$ftMatch = sprintf('rse.query = "@(name,searchname) %s;limit=1000000;maxmatches=1000000;mode=any" AND', str_replace('|', ' ', str_replace('"', '', $regexMatch)));
|
||||
|
||||
|
||||
$ftMatch = sprintf('rse.query = "@(name,searchname) %s;limit=1000000;maxmatches=1000000;mode=any" AND', str_replace('|', ' ', str_replace('"', '', $regexMatch)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ class ReleaseSearch
|
||||
if ($forceLike) {
|
||||
return $this->likeSQL();
|
||||
}
|
||||
|
||||
return $this->sphinxSQL();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace nntmux;
|
||||
|
||||
use App\Models\Release;
|
||||
use Foolz\SphinxQL\Drivers\Pdo\Connection;
|
||||
use Foolz\SphinxQL\Helper;
|
||||
use Foolz\SphinxQL\SphinxQL;
|
||||
use Foolz\SphinxQL\Drivers\Pdo\Connection;
|
||||
|
||||
class SphinxSearch
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@ use App\Models\User;
|
||||
use nntmux\Releases;
|
||||
use App\Models\Group;
|
||||
use App\Models\Category;
|
||||
use nntmux\ReleaseSearch;
|
||||
|
||||
if (! User::isLoggedIn()) {
|
||||
$page->show403();
|
||||
@@ -159,8 +158,6 @@ if (isset($_REQUEST['searchadvr']) && ! isset($_REQUEST['id']) && ! isset($_REQU
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$search_description =
|
||||
'Sphinx Search Rules:<br />
|
||||
The search is case insensitive.<br />
|
||||
|
||||
Reference in New Issue
Block a user