argument('guid')); $idOpt = $this->option('id'); if ($guidArg === '' && ($idOpt === null || $idOpt === '')) { $this->error('You must supply either a GUID argument or --id=.'); return 1; // missing identifier } if ($guidArg !== '' && $idOpt !== null && $idOpt !== '') { $this->error('Provide only one identifier: GUID or --id, not both.'); return 4; // conflicting identifiers } $release = null; $guid = ''; if ($idOpt !== null && $idOpt !== '') { if (! ctype_digit((string) $idOpt)) { $this->error('Release ID must be numeric.'); return 5; // invalid id format } $release = Release::find((int) $idOpt); if ($release === null) { $this->error('Release not found for ID: '.$idOpt); return 2; // not found } $guid = $release->guid; } else { $guid = $guidArg; if ($guid === '') { // should not happen but guard $this->error('GUID is required if --id not supplied.'); return 1; } $release = Release::where('guid', $guid)->first(); if ($release === null) { $this->error('Release not found for GUID: '.$guid); return 2; } } if ($this->option('reset')) { Release::where('id', $release->id)->update([ 'passwordstatus' => -1, 'haspreview' => -1, 'jpgstatus' => 0, 'videostatus' => 0, 'audiostatus' => 0, 'nfostatus' => -1, ]); $this->info('Reset postprocessing flags for release ID '.$release->id.' (GUID '.$guid.')'); } if ($this->option('no-progress')) { config(['nntmux.echocli' => false]); } $processor = app(AdditionalProcessingOrchestrator::class); $ok = $processor->processSingleGuid($guid); if (! $ok) { $this->error('Processing failed or nothing processed for '.($idOpt ? 'ID '.$idOpt : 'GUID '.$guid).'.'); return 3; } $this->info('Additional postprocessing completed for '.($idOpt ? 'ID '.$idOpt : 'GUID '.$guid).'.'); return 0; } }