X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FConsole%2FCommands%2FChatlibDatabase.php;h=9bf143f11e9956d188f81c4e241ba6a749e57876;hb=refs%2Fheads%2Fmaster;hp=e492bb7c1169160fafea1c9a938aec7f5b0c8b86;hpb=4c72d4b8bec61eba5b3dc43df5eafd890e123d37;p=alttp.git diff --git a/app/Console/Commands/ChatlibDatabase.php b/app/Console/Commands/ChatlibDatabase.php index e492bb7..9bf143f 100644 --- a/app/Console/Commands/ChatlibDatabase.php +++ b/app/Console/Commands/ChatlibDatabase.php @@ -13,7 +13,7 @@ class ChatlibDatabase extends Command { * * @var string */ - protected $signature = 'chatlib:database {which=de} {size=7}'; + protected $signature = 'chatlib:database {which=de} {size=3}'; /** * The console command description. @@ -44,10 +44,13 @@ class ChatlibDatabase extends Command { $query->whereNull('detected_language'); $query->orWhere('detected_language', '=', $lang); }) - ->whereRaw('LENGTH(`text_content`) > 10') + ->orderBy('channel_id') + ->orderBy('created_at') ->chunk(5000, function ($msgs) use (&$count, $db) { + $previous = null; foreach ($msgs as $msg) { - $db->addMessage($msg); + $db->addMessage($msg, $previous); + $previous = $msg; ++$count; } $this->line($count);