wip
This commit is contained in:
1 parent
657f356590
commit
23b802abcb
6 files changed
+8
-7
No files matched your search
@@ -50,6 +50,7 @@ class Grapper
|
||||
SofaScoreEventGrapped::where('grapper_id', $task_id)->delete();
|
||||
|
||||
foreach ($days as $day) {
|
||||
// if restarting find position
|
||||
SofaScoreTaskDay::where('grapper_id', (int) $task_id)
|
||||
->where('day', $day)
|
||||
->update(['done' => 0]);
|
||||
@@ -211,7 +212,7 @@ class Grapper
|
||||
$count++;
|
||||
|
||||
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)
|
||||
{
|
||||
$debug = Grap::$options['d'] ?? 0;
|
||||
|
||||
$restart = Grap::$options['restart'] ?? 0;
|
||||
$restart = Grap::$options['r'] ?? 0;
|
||||
|
||||
$dates = [];
|
||||
|
||||
@@ -27,7 +26,7 @@ class LoadDays
|
||||
$task = SofaScoreTask::with('sport')->where('id', $task_id)->first();
|
||||
|
||||
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) {
|
||||
|
||||
@@ -34,7 +34,7 @@ class SetStorage
|
||||
Grap::$zipfile = $sofascore_data . $storage_name . '/' . $task->day_from . '.zip';
|
||||
break;
|
||||
case 3:
|
||||
Grap::$storage = $sofascore_data . 'range/';
|
||||
Grap::$storage = $sofascore_data . 'range/' . $storage_name;
|
||||
Grap::$folder = $storage_name . '-' . $task->day_from . '-' . $task->day_to;
|
||||
break;
|
||||
case 4:
|
||||
|
||||
@@ -9,6 +9,7 @@ class Strings
|
||||
{
|
||||
$string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
|
||||
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
|
||||
$string = strtolower($string);
|
||||
|
||||
return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user