recognize: hide when faces disabled (fix #494)

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
pull/504/head
Varun Patil 2023-03-17 17:03:03 -07:00
parent 68c5b18e08
commit cbef18d1e5
1 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,7 @@ use OCP\App\IAppManager;
use OCP\Files\Node;
use OCP\Files\Search\ISearchBinaryOperator;
use OCP\Files\Search\ISearchComparison;
use OCP\IAppConfig;
use OCP\IConfig;
class Util
@ -87,8 +88,16 @@ class Util
}
$v = $appManager->getAppVersion('recognize');
if (!version_compare($v, '3.0.0-alpha', '>=')) {
return false;
}
return version_compare($v, '3.0.0-alpha', '>=');
$c = \OC::$server->get(IAppConfig::class);
if ('true' !== $c->getValue('recognize', 'faces.enabled', 'false')) {
return false;
}
return true;
}
/**