Compare commits

...

3 Commits

Author SHA1 Message Date
lexx b47c3bdc95 fix rebuild thumbs 2025-01-27 14:05:59 +02:00
lexx c39ec469df files bug 2025-01-22 20:03:12 +02:00
lexx 232fcc8845 csv render title 2024-12-18 13:02:09 +02:00
6 changed files with 14 additions and 10 deletions
+2 -1
View File
@@ -14,7 +14,8 @@
"intervention/image": "^2.7",
"phpoption/phpoption": "^1.9",
"spatie/image-optimizer": "^1.6",
"staudenmeir/laravel-cte": "^1.0"
"staudenmeir/laravel-cte": "^1.0",
"mustache/mustache": "^2.14"
},
"require-dev": {
Generated
+3 -3
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "71cf4c1de3d614ce2f9607763bf5687f",
"content-hash": "e8fb1bee28ad339453d50110f7fea2f5",
"packages": [
{
"name": "brick/math",
@@ -5729,8 +5729,8 @@
"ext-zip": "*",
"ext-sqlite3": "*",
"ext-imagick": "*",
"php": "^8.3",
"ext-pdo": "*"
"ext-pdo": "*",
"php": "^8.3"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"
+1 -1
View File
@@ -42,7 +42,7 @@ class RebuildThumbnails extends Command
public function rebuildThumbnails(FilesSchema $schema): void
{
$this->info("Rebuilding thumbnails for ". $schema->name);
$records = $this->query->filter(["schema" => $schema->name])->run()->records;
$records = $this->query->limit(0)->filter(["schema" => $schema->name])->run()->records;
$disk = $this->fileService->loadDisk($schema->disk);
foreach ($records as $record) {
$this->fileService->createTemplates($disk, $record->_file->path);
+3 -2
View File
@@ -80,7 +80,7 @@ class FileService
}
if($this->isImage($mimetype)){
$this->createTemplates($disk, $path, $file);
$this->createTemplates($disk, $path);
}
@@ -136,7 +136,8 @@ class FileService
{
$originalImage = $this->imageManager->make($disk->get($path));
foreach (config("lucent.imageFilters") as $preset => $filterClass) {
$image = $originalImage->filter(new $filterClass);
$imageClone = clone $originalImage;
$image = $imageClone->filter(new $filterClass);
$templateUri = "/templates/" . $preset . "/" . $path;
$disk->put($templateUri, $image->encode('webp', 75));
}
+4 -2
View File
@@ -20,6 +20,7 @@ use Lucent\Schema\System;
use Lucent\Schema\Ui\Reference;
use Lucent\Schema\Validator\ValidatorException;
use Lucent\Svelte\Svelte;
use Lucent\ViewModel\ViewModel;
use function Lucent\Response\fail;
use function Lucent\Response\ok;
@@ -32,7 +33,8 @@ class RecordController extends Controller
private readonly Svelte $svelte,
private readonly Query $query,
private readonly Manager $recordManager,
private readonly OperatorRegistry $operatorRegistry
private readonly OperatorRegistry $operatorRegistry,
private readonly ViewModel $viewModel,
)
{
}
@@ -176,7 +178,7 @@ class RecordController extends Controller
$c[] = "";
}elseif (count($fieldRecords) === 1){
$c[] = data_get($fieldRecords,"0.id");
$c[] = data_get($fieldRecords,"0.data.name");
$c[] = $this->viewModel->getRecordName($fieldRecords[0]);
}else{
$c[] = collect($fieldRecords)->pluck("id")->join("::");
$c[] = collect($fieldRecords)->pluck("data.name")->join("::");
+1 -1
View File
@@ -21,7 +21,7 @@ class ViewModel
public function getRecordName(QueryRecord $record): string
{
$schema = $this->channelService->getSchema($record->schema)->get();
if (empty($schema->titleTemplate)) {
if (empty($schema->cardTitle)) {
$title = match (get_class($schema)) {
CollectionSchema::class => $record->data[$schema->fields->filter(fn(FieldInterface $f) => $f->info->name === "text")->first()->name],
FilesSchema::class => $record->_file->path,