mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 02:01:33 +00:00
Move adult processing completely to services
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
// This script will update all records in the xxxinfo table where there is no cover
|
||||
require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
|
||||
|
||||
use App\Services\AdultProcessing\AdultProcessingPipeline;
|
||||
use Blacklight\ColorCLI;
|
||||
use Blacklight\XXX;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
$movie = new XXX;
|
||||
$pipeline = new AdultProcessingPipeline([], true);
|
||||
$c = new ColorCLI;
|
||||
|
||||
$movies = DB::select('SELECT title FROM xxxinfo WHERE cover = 0');
|
||||
@@ -15,7 +15,13 @@ $movies = DB::select('SELECT title FROM xxxinfo WHERE cover = 0');
|
||||
echo $c->primary('Updating '.number_format(\count($movies)).' XXX movie covers.');
|
||||
foreach ($movies as $mov) {
|
||||
$starttime = now()->timestamp;
|
||||
$mov = $movie->updateXXXInfo($mov->title);
|
||||
$result = $pipeline->processMovie($mov->title);
|
||||
|
||||
if ($result['status'] === 'matched') {
|
||||
echo $c->primary('Updated: '.$mov->title);
|
||||
} else {
|
||||
echo $c->warning('No match found for: '.$mov->title);
|
||||
}
|
||||
|
||||
// sleep so that it's not ddos' the site
|
||||
$diff = floor((now()->timestamp - $starttime) * 1000000);
|
||||
|
||||
Reference in New Issue
Block a user