This commit is contained in:
salam committed 2026-08-16 20:07:17 +02:00
1 parent 657f356590
commit 23b802abcb
6 files changed
+8 -7

No files matched your search

+1 -1
View File
@@ -77,7 +77,7 @@ class Grap extends Command
case 3: case 3:
SetStorage::set(3); SetStorage::set(3);
// Grapper::load(3); Grapper::load(3);
MakeExcel::create(); MakeExcel::create();
@@ -50,6 +50,7 @@ class Grapper
SofaScoreEventGrapped::where('grapper_id', $task_id)->delete(); SofaScoreEventGrapped::where('grapper_id', $task_id)->delete();
foreach ($days as $day) { foreach ($days as $day) {
// if restarting find position
SofaScoreTaskDay::where('grapper_id', (int) $task_id) SofaScoreTaskDay::where('grapper_id', (int) $task_id)
->where('day', $day) ->where('day', $day)
->update(['done' => 0]); ->update(['done' => 0]);
@@ -211,7 +212,7 @@ class Grapper
$count++; $count++;
if ($debug) { if ($debug) {
Notice::note("$count days done", 'bp'); Notice::note("$count days done", 'p');
} }
} }
} }
@@ -13,8 +13,7 @@ class LoadDays
public static function load(int $task_id) public static function load(int $task_id)
{ {
$debug = Grap::$options['d'] ?? 0; $debug = Grap::$options['d'] ?? 0;
$restart = Grap::$options['r'] ?? 0;
$restart = Grap::$options['restart'] ?? 0;
$dates = []; $dates = [];
@@ -27,7 +26,7 @@ class LoadDays
$task = SofaScoreTask::with('sport')->where('id', $task_id)->first(); $task = SofaScoreTask::with('sport')->where('id', $task_id)->first();
if ($debug) { if ($debug) {
Notice::note('Task id:'.$task->id.', mode:'.$task->mode.', sport:'.$task->sport->name); Notice::note('Task id:' . $task->id . ', mode:' . $task->mode . ', sport:' . $task->sport->name);
} }
switch ($task->mode) { switch ($task->mode) {
@@ -34,7 +34,7 @@ class SetStorage
Grap::$zipfile = $sofascore_data . $storage_name . '/' . $task->day_from . '.zip'; Grap::$zipfile = $sofascore_data . $storage_name . '/' . $task->day_from . '.zip';
break; break;
case 3: case 3:
Grap::$storage = $sofascore_data . 'range/'; Grap::$storage = $sofascore_data . 'range/' . $storage_name;
Grap::$folder = $storage_name . '-' . $task->day_from . '-' . $task->day_to; Grap::$folder = $storage_name . '-' . $task->day_from . '-' . $task->day_to;
break; break;
case 4: case 4:
@@ -9,6 +9,7 @@ class Strings
{ {
$string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens. $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. $string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
$string = strtolower($string);
return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one. return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
} }
+1 -1
View File
@@ -81,7 +81,7 @@ class LoadEvents
$team_position = 'all'; $team_position = 'all';
} }
$expectations = LoadExpectations::load($res['all'], $match, $statistic_type); $expectations = LoadExpectations::load($res['all'] ?? [], $match, $statistic_type);
foreach ($res[$team_position] as $value) { foreach ($res[$team_position] as $value) {