This commit is contained in:
salam committed 2026-10-01 15:10:40 +02:00
1 parent 78db21c71c
commit e1f3b728a9
9 files changed
+252 -203

No files matched your search

+23 -23
View File
@@ -73,19 +73,19 @@ trait GrappingHelper
break;
}
if ($this->restart) {
SofaScoreEventGrapped::where('grapper_id', $this->task_id)->delete();
// if ($this->restart) {
// SofaScoreEventGrapped::where('grapper_id', $this->task_id)->delete();
foreach ($this->days as $day) {
// if restarting find position
SofaScoreTaskDay::where('grapper_id', 1)
->where('day', $day)
->update(['done' => 0]);
}
if ($this->debug) {
Notice::note('Grapper restarted', 'r', 1);
}
}
// foreach ($this->days as $day) {
// // if restarting find position
// SofaScoreTaskDay::where('grapper_id', 1)
// ->where('day', $day)
// ->update(['done' => 0]);
// }
// if ($this->debug) {
// Notice::note('Grapper restarted', 'r', 1);
// }
// }
$this->days = array_unique($this->days, SORT_REGULAR);
}
@@ -97,16 +97,16 @@ trait GrappingHelper
{
switch ($grapperSelected) {
case 'daily':
$this->data_dir = storage_path($this->base_dir).'/daily';
$this->data_dir = storage_path($this->base_dir) . '/daily';
break;
case 'range':
$this->data_dir = storage_path($this->base_dir).'/range';
$this->data_dir = storage_path($this->base_dir) . '/range';
break;
case 'rose':
$this->data_dir = storage_path($this->base_dir).'/rose';
$this->data_dir = storage_path($this->base_dir) . '/rose';
break;
case 'player':
$this->data_dir = storage_path($this->base_dir).'/player';
$this->data_dir = storage_path($this->base_dir) . '/player';
break;
case 'excel':
case 'mail':
@@ -231,7 +231,7 @@ trait GrappingHelper
if (! $this->force && $has) {
if ($this->debug) {
Notice::note("tournaments $day for ".strtoupper($slug).' allready grapped', 'bb');
Notice::note("tournaments $day for " . strtoupper($slug) . ' allready grapped', 'bb');
}
} else {
@@ -246,7 +246,7 @@ trait GrappingHelper
$this->sleep();
$url = $this->base_url."api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
$url = $this->base_url . "api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
$cloudflareService = new CloudflareSolverService;
@@ -372,7 +372,7 @@ trait GrappingHelper
{
$files = scandir($dir);
foreach ($files as $value) {
$path = realpath($dir.DIRECTORY_SEPARATOR.$value);
$path = realpath($dir . DIRECTORY_SEPARATOR . $value);
if (! is_dir($path)) {
$results[] = $path;
} elseif ($value != '.' && $value != '..') {
@@ -395,7 +395,7 @@ trait GrappingHelper
protected function clear_folder(string $folder, $what = '')
{
$mainFolder = storage_path($this->base_dir.'/'.$folder);
$mainFolder = storage_path($this->base_dir . '/' . $folder);
if (! $what) {
$what = $this->select_what_delete();
@@ -426,8 +426,8 @@ trait GrappingHelper
$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));
->reject(fn(string $file) => $file === '.gitignore')
->reject(fn(string $file) => in_array($file, $tasks))
->each(fn($file) => Storage::disk('public')->delete($file));
}
}