]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6294 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 19 Sep 2023 14:18:54 +0000 (16:18 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 19 Sep 2023 14:18:54 +0000 (16:18 +0200)
app/Fluidbook/Compiler/Cache.php
app/Models/FluidbookPublication.php

index f877e8492b5b9517c673219246d7aa01316341dc..c4211f1e6d2a7b29d4e2b2c79d82d60bea83efa6 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace App\Fluidbook\Compiler;
 
+use Cubist\Util\Files\Files;
+
 trait Cache
 {
     protected $_compiledCacheDate = null;
@@ -73,7 +75,15 @@ trait Cache
 
     protected function _cacheKey($key)
     {
-        return 'compiler_cached_' . $this->getFluidbook()->id . '_' . $this->getCompositionTimestamp() . '_' . $key;
+        $res = 'compiler_cached_' . $this->getFluidbook()->id . '_' . $this->getCompositionTimestamp() . '_' . $key;
+        $fb = $this->getFluidbook();
+        if ($fb->pdfThumbnails) {
+            $thumbPdf = $fb->getAssetDir() . $fb->pdfThumbnails;
+            if (file_exists($thumbPdf)) {
+                $res .= '_' . Files::hashFileAttributes($thumbPdf);
+            }
+        }
+        return $res;
     }
 
 
index e04ffbc8545004484f9ac92b0d719f3b7ee55e8f..b03fdc6cb1483793f106cfb03c24fa05735713d8 100644 (file)
@@ -432,8 +432,11 @@ class FluidbookPublication extends ToolboxSettingsModel
     {
         if ($this->pdfThumbnails) {
             $thumbpdf = $this->getAssetDir() . $this->pdfThumbnails;
+
             if (file_exists($thumbpdf)) {
-                return Farm::getFileFromPDF($thumbpdf, $page, $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, null, $force);
+                $res = Farm::getFileFromPDF($thumbpdf, $page, $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, null, $force);
+                return $res;
+            } else {
             }
         }
         return $this->getFile($page, $format, $resolution, $withText, $withGraphics, $version, $force);