From d789fb6b41228570c5ef9063995f60ed37b52908 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 5 Aug 2023 15:47:34 +0200 Subject: [PATCH] Fix Duplicates in Groupfolders: Only scan each groupfolder once fixes #916 Signed-off-by: Marcel Klehr --- lib/Service/StorageService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/StorageService.php b/lib/Service/StorageService.php index d068ee2e..10d80168 100644 --- a/lib/Service/StorageService.php +++ b/lib/Service/StorageService.php @@ -53,7 +53,7 @@ public function __construct(IDBConnection $db, Logger $logger, SystemConfig $sys */ public function getMounts(): \Generator { $qb = $this->db->getQueryBuilder(); - $qb->select('root_id', 'storage_id', 'mount_provider_class') + $qb->selectDistinct(['root_id', 'storage_id', 'mount_provider_class']) // to avoid scanning each occurrence of a groupfolder ->from('mounts') ->where($qb->expr()->in('mount_provider_class', $qb->createPositionalParameter(self::ALLOWED_MOUNT_TYPES, IQueryBuilder::PARAM_STR_ARRAY))); $result = $qb->executeQuery();