From 48fd019b864533b340409b93762c098c5cf3532a Mon Sep 17 00:00:00 2001 From: Benjamin Hirsch Date: Fri, 14 Jul 2017 12:39:11 +0200 Subject: [PATCH] Changed the listing behavior, excluded the _processed_ folder --- Classes/Driver/StorageDriver.php | 17 ++++++++++++++++- ext_emconf.php | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Classes/Driver/StorageDriver.php b/Classes/Driver/StorageDriver.php index 290c08c..b6e537c 100644 --- a/Classes/Driver/StorageDriver.php +++ b/Classes/Driver/StorageDriver.php @@ -16,6 +16,7 @@ use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend; use TYPO3\CMS\Core\Resource\Driver\AbstractHierarchicalFilesystemDriver; use TYPO3\CMS\Core\Resource\FileRepository; +use TYPO3\CMS\Core\Resource\Folder; use TYPO3\CMS\Core\Resource\ResourceStorage; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -749,6 +750,7 @@ public function getFilesInFolder( $options->setIncludeSnapshots(false); $options->setIncludeCopy(false); $options->setIncludeMetadata(false); + $options->setDelimiter($this->getProcessingFolder()); /** @var ListBlobsResult $blobList */ $blobList = $this->blobService->listBlobs($this->container, $options); @@ -847,6 +849,7 @@ public function getFoldersInFolder( $options->setIncludeSnapshots(false); $options->setIncludeCopy(false); $options->setIncludeMetadata(false); + $options->setDelimiter($this->getProcessingFolder()); /** @var ListBlobsResult $blobList */ $blobList = $this->blobService->listBlobs($this->container, $options); @@ -1075,7 +1078,19 @@ protected function getStorage() */ protected function getProcessingFolder() { - return $this->getStorage()->getProcessingFolders() ? $this->getStorage()->getProcessingFolders()[0] : '_processed_'; + $folders = $this->getStorage()->getProcessingFolders(); + + if (is_array($folders)) { + /** @var Folder $folder */ + foreach ($folders as $folder) { + if ($this->getStorage()->getUid() === $folder->getStorage()->getUid()) { + return $folder->getName(); + } + } + } + + // Just in case + return '_processed_'; } /** diff --git a/ext_emconf.php b/ext_emconf.php index 6833973..f6f58bb 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -2,9 +2,9 @@ $EM_CONF[$_EXTKEY] = [ 'title' => 'Azure Storage', - 'description' => 'Microsoft Azure Blob Storage to TYPO3', + 'description' => 'Microsoft Azure Blob Storage for TYPO3', 'category' => 'be', - 'version' => '0.3.2', + 'version' => '0.3.3', 'state' => 'beta', 'clearcacheonload' => 1, 'author' => 'Benjamin Hirsch',