wip
This commit is contained in:
1 parent
31dd27dd73
commit
254ca94d73
4 files changed
+80
-237
No files matched your search
@@ -11,11 +11,13 @@ use App\Models\SofaScoreTask;
|
||||
use App\Models\SofaScoreTaskDay;
|
||||
use App\Models\SofaScoreTaskTournament;
|
||||
use App\Models\SofaScoreTournament;
|
||||
use App\Models\StatistikoImport;
|
||||
use App\Services\CloudflareSolverService;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
trait GrappingHelper
|
||||
{
|
||||
@@ -125,9 +127,11 @@ trait GrappingHelper
|
||||
{
|
||||
switch ($grapperSelected) {
|
||||
case 'daily':
|
||||
case 'range':
|
||||
$this->tournaments_requested = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', 1)->where('disabled', false)->get()->toArray();
|
||||
break;
|
||||
case 'range':
|
||||
$this->tournaments_requested = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', 3)->where('disabled', false)->get()->toArray();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,4 +424,14 @@ trait GrappingHelper
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected function delete_imported_files_orphants(): void
|
||||
{
|
||||
$tasks = StatistikoImport::pluck('file_name')->toArray();
|
||||
|
||||
collect(Storage::disk('public')->allFiles('statistiko'))
|
||||
->reject(fn (string $file) => $file === '.gitignore')
|
||||
->reject(fn (string $file) => in_array($file, $tasks))
|
||||
->each(fn ($file) => Storage::disk('public')->delete($file));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user