Skip to content

Commit

Permalink
Changed the listing behavior, excluded the _processed_ folder
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminhirsch committed Jul 14, 2017
1 parent ea90ed3 commit 48fd019
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion Classes/Driver/StorageDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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_';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 48fd019

Please sign in to comment.