From b37804a383d8c6df65ff3524cb867e25ec75c534 Mon Sep 17 00:00:00 2001 From: RedFreak_ Date: Sat, 5 Nov 2022 18:50:24 +0100 Subject: [PATCH] FIX: the truncating of paraphrases is not done multiple times by each file --- app/Console/Commands/ImportHtmlCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/ImportHtmlCommand.php b/app/Console/Commands/ImportHtmlCommand.php index 7ca527b..0f56f6f 100644 --- a/app/Console/Commands/ImportHtmlCommand.php +++ b/app/Console/Commands/ImportHtmlCommand.php @@ -38,6 +38,9 @@ public function handle() exit(Command::FAILURE); } + Paraphrase::truncate(); + $this->warn('All paraphrases deleted.'); + $files = File::glob(storage_path('sources/*.html')); foreach($files as $file) { @@ -120,9 +123,6 @@ private function createEditors(array $contentRows): Collection */ private function createParaphrases(array $contentRows, Collection $editors): void { - Paraphrase::truncate(); - $this->warn('All paraphrases deleted.'); - $rows = count(data_get($contentRows, 'editor', [])); $this->info('Creating new paraphrases'); $bar = new ProgressBar($this->output, $rows);