Move adult processing completely to services

This commit is contained in:
DariusIII
2025-12-19 16:14:16 +01:00
parent 8a470d7911
commit ab1562577b
15 changed files with 77 additions and 2577 deletions
+9 -3
View File
@@ -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);