Skip to content

Commit af9064c

Browse files
author
Zane
committed
Add image hash (unique)
1 parent 5e58a7a commit af9064c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/Command/TLI1ImporterCommand.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TLI1ImporterCommand extends AbstractBaseCommand
6464

6565

6666
public function __construct(
67-
array $arrConfig, protected ProjectDir $projectDir, protected Factory $Factory,
67+
array $arrConfig, protected ProjectDir $projectDir, protected Factory $factory,
6868
protected TextProcessor $textProcessor, protected HtmlProcessorForStorage $htmlProcessor,
6969

7070
protected EntityManagerInterface $em,
@@ -497,7 +497,7 @@ protected function importImages() : static
497497
$this->processItems($arrTli1Images, [$this, 'processTli1Image'], null, [$this, 'buildItemTitle']);
498498

499499
$this
500-
->fxTitle("Assigning the cover image to each article...")
500+
->fxTitle("Assigning the spotlight to each article...")
501501
->processItems($this->arrNewArticles, [$this, 'assignSpotlight'], null, function(){ return '';} );
502502

503503
return $this;
@@ -527,6 +527,8 @@ protected function processTli1Image(int $imageId, array $arrImage)
527527
->setTitle($title)
528528
->setFormat($format)
529529
->setWatermarkPosition($watermark)
530+
// unique hash wasn't implemented in TLI1 -> real hashing would violate it
531+
->setHash("tli1-import_" . $imageId)
530532
->setCreatedAt($createdAt)
531533
->setUpdatedAt($createdAt);
532534

@@ -576,7 +578,7 @@ protected function processTli1Image(int $imageId, array $arrImage)
576578
$this->arrNewImages[$imageId] = $entityTli2Image;
577579

578580
// file copy
579-
$imageService = $this->Factory->createImage($entityTli2Image);
581+
$imageService = $this->factory->createImage($entityTli2Image);
580582
$filename = $imageService->getOriginalFileName();
581583
$sourceFilePath = $this->projectDir->getVarDirFromFilePath("uploaded-assets-downloaded-from-remote/images/$filename");
582584
$destFilePath = $imageService->getOriginalFilePath();
@@ -908,7 +910,7 @@ protected function processTli1File(int $fileId, array $arrFile)
908910
$this->arrNewFiles[$fileId] = $entityTli2File;
909911

910912

911-
$fileService = $this->Factory->createFile($entityTli2File);
913+
$fileService = $this->factory->createFile($entityTli2File);
912914
if( !$fileService->isLocal() ) {
913915
return $this;
914916
}

0 commit comments

Comments
 (0)