Use correct getSystemValue type

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
This commit is contained in:
J0WI 2021-04-12 22:53:34 +02:00
parent 4be2e1601e
commit 74a7c2eefc
5 changed files with 6 additions and 6 deletions

View File

@ -144,7 +144,7 @@ class ShareesAPIController extends OCSController {
public function search(string $search = '', string $itemType = null, int $page = 1, int $perPage = 200, $shareType = null, bool $lookup = true): DataResponse {
// only search for string larger than a given threshold
$threshold = (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0);
$threshold = $this->config->getSystemValueInt('sharing.minSearchStringLength', 0);
if (strlen($search) < $threshold) {
return new DataResponse($this->result);
}

View File

@ -46,7 +46,7 @@ class CreateSessionTokenCommand extends ALoginCommand {
public function process(LoginData $loginData): LoginResult {
$tokenType = IToken::REMEMBER;
if ((int)$this->config->getSystemValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15) === 0) {
if ($this->config->getSystemValueInt('remember_login_cookie_lifetime', 60 * 60 * 24 * 15) === 0) {
$loginData->setRememberLogin(false);
$tokenType = IToken::DO_NOT_REMEMBER;
}

View File

@ -66,7 +66,7 @@ class LookupPlugin implements ISearchPlugin {
public function search($search, $limit, $offset, ISearchResult $searchResult) {
$isGlobalScaleEnabled = $this->config->getSystemValue('gs.enabled', false);
$isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
$hasInternetConnection = (bool)$this->config->getSystemValue('has_internet_connection', true);
$hasInternetConnection = $this->config->getSystemValueBool('has_internet_connection', true);
// if case of Global Scale we always search the lookup server
if (!$isGlobalScaleEnabled && (!$isLookupServerEnabled || !$hasInternetConnection)) {

View File

@ -238,8 +238,8 @@ class Generator {
continue;
}
$maxWidth = (int)$this->config->getSystemValue('preview_max_x', 4096);
$maxHeight = (int)$this->config->getSystemValue('preview_max_y', 4096);
$maxWidth = $this->config->getSystemValueInt('preview_max_x', 4096);
$maxHeight = $this->config->getSystemValueInt('preview_max_y', 4096);
$preview = $this->helper->getThumbnail($provider, $file, $maxWidth, $maxHeight);

View File

@ -38,7 +38,7 @@ abstract class Image extends ProviderV2 {
* {@inheritDoc}
*/
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
$maxSizeForImages = \OC::$server->getConfig()->getSystemValue('preview_max_filesize_image', 50);
$maxSizeForImages = \OC::$server->getConfig()->getSystemValueInt('preview_max_filesize_image', 50);
$size = $file->getSize();
if ($maxSizeForImages !== -1 && $size > ($maxSizeForImages * 1024 * 1024)) {