diff --git a/plugins/AudioEncoder/templates/audioEncoder/audioEncoderView.html.twig b/plugins/AudioEncoder/templates/audioEncoder/audioEncoderView.html.twig index fd6651ce65..01596cfeb8 100644 --- a/plugins/AudioEncoder/templates/audioEncoder/audioEncoderView.html.twig +++ b/plugins/AudioEncoder/templates/audioEncoder/audioEncoderView.html.twig @@ -2,8 +2,12 @@
-
{{ attachment.getBestTitle(note) }} +
+ {% if attachment.getFilename() is not null %} + {{ attachment.getBestTitle(note) }} + {% else %} + {{ attachment.getBestTitle(note) }} + {% endif %}
diff --git a/plugins/ImageEncoder/templates/imageEncoder/imageEncoderView.html.twig b/plugins/ImageEncoder/templates/imageEncoder/imageEncoderView.html.twig index 17b623ca7b..489b14f13c 100644 --- a/plugins/ImageEncoder/templates/imageEncoder/imageEncoderView.html.twig +++ b/plugins/ImageEncoder/templates/imageEncoder/imageEncoderView.html.twig @@ -5,7 +5,11 @@ src="{{ attachment.getThumbnailUrl() }}" width="{{ thumbnail.getWidth() }}" height="{{ thumbnail.getHeight() }}"> -
{{ attachment.getBestTitle(note) }} -
+
+ {% if attachment.getFilename() is not null %} + {{ attachment.getBestTitle(note) }} + {% else %} + {{ attachment.getBestTitle(note) }} + {% endif %} +
diff --git a/plugins/StoreRemoteMedia/StoreRemoteMedia.php b/plugins/StoreRemoteMedia/StoreRemoteMedia.php index 3fdb427a83..e0aa7c926c 100644 --- a/plugins/StoreRemoteMedia/StoreRemoteMedia.php +++ b/plugins/StoreRemoteMedia/StoreRemoteMedia.php @@ -78,7 +78,7 @@ class StoreRemoteMedia extends Plugin private function getStoreOriginal(): bool { - return $this->store_original; + return $this->store_original ?? Common::config('plugin_store_remote_media', 'store_original'); } private function getThumbnailWidth(): int @@ -93,12 +93,12 @@ class StoreRemoteMedia extends Plugin private function getMaxSize(): int { - return $this->max_size ?? Common::config('attachments', 'file_quota'); + return $this->max_size ?? Common::config('plugin_store_remote_media', 'max_file_size'); } private function getSmartCrop(): bool { - return $this->smart_crop ?? Common::config('thumbnail', 'smart_crop'); + return $this->smart_crop ?? Common::config('plugin_store_remote_media', 'smart_crop'); } /** @@ -127,6 +127,7 @@ class StoreRemoteMedia extends Plugin ); // If it was handled already + // XXX: Maybe it would be interesting to have retroactive application of $this->getOriginal here if (!\is_null($attachment_to_link)) { // Relate the note with the existing attachment DB::persist(AttachmentToNote::create([ diff --git a/plugins/VideoEncoder/templates/videoEncoder/videoEncoderView.html.twig b/plugins/VideoEncoder/templates/videoEncoder/videoEncoderView.html.twig index 82af8f382f..76f04c15ab 100644 --- a/plugins/VideoEncoder/templates/videoEncoder/videoEncoderView.html.twig +++ b/plugins/VideoEncoder/templates/videoEncoder/videoEncoderView.html.twig @@ -2,8 +2,12 @@
-
{{ attachment.getBestTitle(note) }} +
+ {% if attachment.getFilename() is not null %} + {{ attachment.getBestTitle(note) }} + {% else %} + {{ attachment.getBestTitle(note) }} + {% endif %}
diff --git a/social.yaml b/social.yaml index 1ecec4eb01..622b72a5f5 100644 --- a/social.yaml +++ b/social.yaml @@ -129,6 +129,7 @@ parameters: extension: '.webp' plugin_store_remote_media: + store_original: false max_file_size: 4000000 smart_crop: false