From af43da96074915bbc0e0ddbb1d08631582b8079c Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 23 Jan 2015 15:02:17 +0100 Subject: [PATCH] Add max parallels to getcapabiltilies If SQLite, limit parallel upload to 1 --- apps/files/lib/capabilities.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/files/lib/capabilities.php b/apps/files/lib/capabilities.php index 690cc314ccd6..df90eb433aec 100644 --- a/apps/files/lib/capabilities.php +++ b/apps/files/lib/capabilities.php @@ -11,13 +11,23 @@ class Capabilities { public static function getCapabilities() { + $caps = array( + 'bigfilechunking' => true, + ); + + if (\OC_Config::getValue('dbtype', 'sqlite') === 'sqlite3') { + $caps['maxparallels'] = 1; + } else { + $caps['maxparallels'] = 0; + } + return new \OC_OCS_Result(array( 'capabilities' => array( - 'files' => array( - 'bigfilechunking' => true, - ), + 'files' => $caps ), - )); + ) + ); + return new \OC_OCS_Result($caps); } }