summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview/Generator.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-06-04 15:25:25 +0200
committerRobin Appelman <robin@icewind.nl>2019-06-17 14:09:09 +0200
commit615061437422499025e038483504d4ef2004c8e1 (patch)
treebd8752decea5d8c10fea43bdcdd92c38c26ebf30 /lib/private/Preview/Generator.php
parentf6ad353c7c1176bcaa167051c9f3e118e69f7a20 (diff)
downloadnextcloud-server-615061437422499025e038483504d4ef2004c8e1.tar.gz
nextcloud-server-615061437422499025e038483504d4ef2004c8e1.zip
Add new Provider interface for preview providers
the main difference is passing the `File` object to the provider instead of a `View` + path Old providers will still continue to work as before Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Preview/Generator.php')
-rw-r--r--lib/private/Preview/Generator.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php
index 1f7decf2b79..2f9401af385 100644
--- a/lib/private/Preview/Generator.php
+++ b/lib/private/Preview/Generator.php
@@ -35,6 +35,8 @@ use OCP\IConfig;
use OCP\IImage;
use OCP\IPreview;
use OCP\Preview\IProvider;
+use OCP\Preview\IProviderV2;
+use OCP\Preview\IVersionedPreviewFile;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
@@ -178,9 +180,9 @@ class Generator {
continue;
}
- foreach ($providers as $provider) {
- $provider = $this->helper->getProvider($provider);
- if (!($provider instanceof IProvider)) {
+ foreach ($providers as $providerClosure) {
+ $provider = $this->helper->getProvider($providerClosure);
+ if (!($provider instanceof IProviderV2)) {
continue;
}