summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-04-25 13:50:19 +0200
committerRobin Appelman <icewind@owncloud.com>2016-04-25 14:21:15 +0200
commit7e8fd2c639f0f28a3eaf2f62cf98ca0f37ec5396 (patch)
treef6b4f1c3299e2604b2034cf5d2a3a68f40355363 /apps/files_external
parent7a22e3f083af7a7c64a022af6e6e5aa9e478cc6a (diff)
downloadnextcloud-server-7e8fd2c639f0f28a3eaf2f62cf98ca0f37ec5396.tar.gz
nextcloud-server-7e8fd2c639f0f28a3eaf2f62cf98ca0f37ec5396.zip
don't get the config for the same mount multiple times
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/service/dbconfigservice.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/files_external/service/dbconfigservice.php b/apps/files_external/service/dbconfigservice.php
index a37c541f045..9f7061eb938 100644
--- a/apps/files_external/service/dbconfigservice.php
+++ b/apps/files_external/service/dbconfigservice.php
@@ -322,10 +322,19 @@ class DBConfigService {
private function getMountsFromQuery(IQueryBuilder $query) {
$result = $query->execute();
$mounts = $result->fetchAll();
+ $uniqueMounts = [];
+ foreach ($mounts as $mount) {
+ $id = $mount['mount_id'];
+ if (!isset($uniqueMounts[$id])) {
+ $uniqueMounts[$id] = $mount;
+ }
+ }
+ $uniqueMounts = array_values($uniqueMounts);
$mountIds = array_map(function ($mount) {
return $mount['mount_id'];
- }, $mounts);
+ }, $uniqueMounts);
+ $mountIds = array_values(array_unique($mountIds));
$applicable = $this->getApplicableForMounts($mountIds);
$config = $this->getConfigForMounts($mountIds);
@@ -338,7 +347,7 @@ class DBConfigService {
$mount['config'] = $config;
$mount['options'] = $options;
return $mount;
- }, $mounts, $applicable, $config, $options);
+ }, $uniqueMounts, $applicable, $config, $options);
}
/**