]> _ Git - fluidbook_tools.git/commitdiff
wip #7423 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Apr 2025 15:09:39 +0000 (17:09 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Apr 2025 15:09:39 +0000 (17:09 +0200)
src/Links/ZoomLink.php

index 5dbcd287cea75a9b67860bd8c77630ca67d0bbd5..6053158b4caa5bd07807dc993b9e24eee79e52dc 100644 (file)
@@ -244,7 +244,16 @@ class ZoomLink extends NormalLink
             $compiler->addIssue(16, ['error' => 'File empty', 'uid' => $attributes['id'], 'page' => $attributes['page']]);
             return null;
         }
-        $dest = 'data/links/' . $save . '_' . $attributes['id'] . '.' . $ext;
+        $f = $save . '_' . $attributes['id'] . '.' . $ext;
+        $dest = 'data/links/' . $f;
+        if (isset($compiler->book_id)) {
+            $d = Files::mkdir($cache . '/books/' . $compiler->book_id . '/data/links');
+            $link = $d . $f;
+            if (is_link($link)) {
+                unlink($link);
+            }
+            symlink($both, $link);
+        }
         if ($copy) {
             $compiler->simpleCopyLinkFile($both, $dest);
         }