remove days and add tasks

This commit is contained in:
salam committed 2026-07-01 15:44:30 +02:00
1 parent be2a16a812
commit 23a367c493
31 files changed
+237 -464

No files matched your search

@@ -7,10 +7,6 @@ use App\Console\Commands\Grapper\Sofascore\EventsDatabase;
use App\Console\Commands\Grapper\Sofascore\Special;
use App\Console\Commands\Grapper\Sofascore\Tournament;
use App\Console\Commands\Nuh;
use App\Models\SofaScoreCategorie;
use App\Models\SofaScoreDay;
use App\Models\SofaScoreDayTournament;
use App\Models\SofaScoreTournament;
use App\Utilities\Notice;
use DateTime;
use Illuminate\Support\Carbon;
@@ -29,14 +25,6 @@ class Sofascore
{
$debug = Nuh::$options['d'] ?? 0;
if (Nuh::$options['truncate']) {
SofaScoreDayTournament::truncate();
SofaScoreTournament::truncate();
SofaScoreDay::truncate();
SofaScoreCategorie::truncate();
Notice::note('Table SofaScoreDay, SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated!', 'b', 1);
}
if (Nuh::$options['t']) {
self::$_days[] = Carbon::now()->format('Y-m-d');
} elseif (Nuh::$options['day']) {
@@ -2,7 +2,6 @@
namespace App\Console\Commands\Grapper\Sofascore;
use App\Console\Commands\Grapper\Sofascore\Tools\LoadDays;
use App\Console\Commands\Grapper\Sofascore\Tools\LoadTournaments;
use App\Console\Commands\Nuh;
use App\Utilities\Notice;
@@ -12,7 +11,7 @@ class EventsDatabase
{
public static $storage_path = '/Console/Commands/Grapper/Sofascore/grapped/';
public static function load()
public static function load($days)
{
$debug = Nuh::$options['d'] ?? 0;
@@ -20,8 +19,6 @@ class EventsDatabase
$langsam = Nuh::$options['l'] ?? 0;
$days = LoadDays::load();
$tornaments = LoadTournaments::load();
if ($print) {
@@ -2,17 +2,14 @@
namespace App\Console\Commands\Grapper\Sofascore\Specials;
use App\Console\Commands\Grapper\Sofascore\Tools\LoadDays;
use App\Utilities\Notice;
use App\Utilities\ZipFolder;
class CreateZip
{
public static function run()
public static function run($days)
{
$days = LoadDays::load();
foreach ($days as $day) {
ZipFolder::create($day);
}
@@ -3,16 +3,13 @@
namespace App\Console\Commands\Grapper\Sofascore\Specials;
use App\Console\Commands\Grapper\Sofascore\Special;
use App\Console\Commands\Grapper\Sofascore\Tools\LoadDays;
use App\Utilities\Notice;
use Illuminate\Support\Facades\Mail;
class SendMail
{
public static function run()
public static function run($days)
{
$days = LoadDays::load();
foreach ($days as $day) {
$zip_file = Special::$storage_path.'/'.$day.'.zip';
@@ -5,7 +5,6 @@ namespace App\Console\Commands\Grapper\Sofascore;
use App\Console\Commands\Nuh;
use App\Models\Country;
use App\Models\SofaScoreCategorie;
use App\Models\SofaScoreDay;
use App\Models\SofaScoreDayTournament;
use App\Models\SofaScoreTournament;
use App\Models\Sport;
@@ -49,10 +48,12 @@ class Tournament
$tournaments_counter = 0;
Notice::note('needs day fixing', 'br', 1);
/**
* grap only one time/sport check
*/
if ($force || ! SofaScoreDay::where('day', $day)->where($sport->ss_slug, 1)->first()) {
if ($force) {
if ($debug) {
Notice::note('Grapping Sport: ' . Nuh::$options['sport'] . ' Day: ' . $day, 'p');
@@ -181,7 +182,6 @@ class Tournament
Notice::note("tournaments: $tournaments_counter", 'p');
}
SofaScoreDay::updateOrCreate(['day' => $day], ['sport_id' => $sport->id]);
}
} else {
if ($debug) {