@@ -29,31 +29,31 @@ |
||
29 | 29 | use OCP\Preview\IProviderV2; |
30 | 30 | |
31 | 31 | class ProviderV1Adapter implements IProviderV2 { |
32 | - private $providerV1; |
|
32 | + private $providerV1; |
|
33 | 33 | |
34 | - public function __construct(IProvider $providerV1) { |
|
35 | - $this->providerV1 = $providerV1; |
|
36 | - } |
|
34 | + public function __construct(IProvider $providerV1) { |
|
35 | + $this->providerV1 = $providerV1; |
|
36 | + } |
|
37 | 37 | |
38 | - public function getMimeType(): string { |
|
39 | - return $this->providerV1->getMimeType(); |
|
40 | - } |
|
38 | + public function getMimeType(): string { |
|
39 | + return $this->providerV1->getMimeType(); |
|
40 | + } |
|
41 | 41 | |
42 | - public function isAvailable(FileInfo $file): bool { |
|
43 | - return $this->providerV1->isAvailable($file); |
|
44 | - } |
|
42 | + public function isAvailable(FileInfo $file): bool { |
|
43 | + return $this->providerV1->isAvailable($file); |
|
44 | + } |
|
45 | 45 | |
46 | - public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
47 | - list($view, $path) = $this->getViewAndPath($file); |
|
48 | - $thumbnail = $this->providerV1->getThumbnail($path, $maxX, $maxY, false, $view); |
|
49 | - return $thumbnail === false ? null: $thumbnail; |
|
50 | - } |
|
46 | + public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
47 | + list($view, $path) = $this->getViewAndPath($file); |
|
48 | + $thumbnail = $this->providerV1->getThumbnail($path, $maxX, $maxY, false, $view); |
|
49 | + return $thumbnail === false ? null: $thumbnail; |
|
50 | + } |
|
51 | 51 | |
52 | - private function getViewAndPath(File $file) { |
|
53 | - $view = new View($file->getParent()->getPath()); |
|
54 | - $path = $file->getName(); |
|
52 | + private function getViewAndPath(File $file) { |
|
53 | + $view = new View($file->getParent()->getPath()); |
|
54 | + $path = $file->getName(); |
|
55 | 55 | |
56 | - return [$view, $path]; |
|
57 | - } |
|
56 | + return [$view, $path]; |
|
57 | + } |
|
58 | 58 | |
59 | 59 | } |