From: soufiane Date: Mon, 3 Nov 2025 18:21:16 +0000 (+0100) Subject: wip #7819 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=17fd5fd6363c9633bc3408bc9863e8360fb8cbf0;p=fluidbook-toolbox.git wip #7819 --- diff --git a/app/Console/Commands/AddFluidbookHemsleyToCollection.php b/app/Console/Commands/AddFluidbookHemsleyToCollection.php new file mode 100644 index 000000000..59ce4f5e0 --- /dev/null +++ b/app/Console/Commands/AddFluidbookHemsleyToCollection.php @@ -0,0 +1,35 @@ +argument('id')); $c->runAuditLink($this->option('sync', false)); - //$f->generateThumbnailsPreview($this->option('sync', false)); } } diff --git a/app/Console/Commands/addFluidbookHemsleyToCollection.php b/app/Console/Commands/addFluidbookHemsleyToCollection.php deleted file mode 100644 index f9bd9ca81..000000000 --- a/app/Console/Commands/addFluidbookHemsleyToCollection.php +++ /dev/null @@ -1,36 +0,0 @@ -generateThumbnailsPreview($this->option('sync', false)); - $data = FluidbookPublication::getFluidbooksHemsley(); - FluidbookCollection::updateHemsleyCollection($data); - } -} diff --git a/app/Jobs/AuditLink.php b/app/Jobs/AuditLink.php index 0a2d35a53..e1dcb3d9a 100644 --- a/app/Jobs/AuditLink.php +++ b/app/Jobs/AuditLink.php @@ -42,14 +42,15 @@ class AuditLink extends Base // Error code start with 4 or 5 // Redirection code start with 3 $httpCode = FluidbookAuditLink::getHttpCode($link['to']); + $comment = FluidbookAuditLink::getHttpCodeComment($httpCode); $externalLinks[] = [ + 'link_id' => $link['uid'], 'fluidbook_id' => intval($publication['fluidbook']), 'page' => intval($link['page']), - 'link_id' => $link['uid'], - 'error_code' => str_starts_with($httpCode, 4) || str_starts_with($httpCode, 5) ? $httpCode : "", - 'first_time_error' => '', // Datetime of the first time we saw this error - 'last_date_test' => time(), + 'error_code' => str_starts_with($httpCode, 4) || str_starts_with($httpCode, 5) ? $httpCode.$comment : "", + 'first_time_error' => "", // Datetime of the first time we saw this error + 'last_date_test' => date('Y-m-d H:i:s'), 'url' => $link['to'], 'new_url' => '', 'redirection_code' => str_starts_with($httpCode, 3) ? $httpCode : "", @@ -61,7 +62,7 @@ class AuditLink extends Base } } - $audit = FluidbookAuditLink::insert($externalLinks); + FluidbookAuditLink::updateOrCreate($externalLinks); Log::info('Job exécuté avec succès'); }