diff --git a/lib/Operation.php b/lib/Operation.php index f4bad39..3dbfc7d 100644 --- a/lib/Operation.php +++ b/lib/Operation.php @@ -36,7 +36,7 @@ use OCP\BackgroundJob\IJobList; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\GenericEvent; -use OCP\Files\Folder; +use OCP\Files\File as FileNode; use OCP\Files\InvalidPathException; use OCP\Files\IRootFolder; use OCP\Files\Node; @@ -145,7 +145,7 @@ public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatch // '', admin, 'files', 'path/to/file.txt' [, , $folder,] = explode('/', $node->getPath(), 4); - if ($folder !== 'files' || $node instanceof Folder) { + if ($folder !== 'files' || !($node instanceof FileNode)) { return; } @@ -196,9 +196,7 @@ protected function buildCommand(string $template, Node $node, string $event, arr if (strpos($command, '%f')) { try { $view = new View(); - if ($node instanceof Folder) { - $fullPath = $view->getLocalFolder($node->getPath()); - } else { + if ($node instanceof FileNode) { $fullPath = $view->getLocalFile($node->getPath()); } if ($fullPath === null) {