mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(taskprocessing): move LAZY_CONFIG_KEYS constant to the private namespace
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
f22f7311de
commit
be7ef439cf
4 changed files with 7 additions and 12 deletions
|
|
@ -38,7 +38,7 @@ class AISettingsController extends Controller {
|
|||
if (!isset($settings[$key])) {
|
||||
continue;
|
||||
}
|
||||
$this->appConfig->setValueString('core', $key, json_encode($settings[$key]), lazy: in_array($key, \OCP\TaskProcessing\IManager::LAZY_CONFIG_KEYS, true));
|
||||
$this->appConfig->setValueString('core', $key, json_encode($settings[$key]), lazy: in_array($key, \OC\TaskProcessing\Manager::LAZY_CONFIG_KEYS, true));
|
||||
}
|
||||
|
||||
return new DataResponse();
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class ArtificialIntelligence implements IDelegatedSettings {
|
|||
];
|
||||
foreach ($settings as $key => $defaultValue) {
|
||||
$value = $defaultValue;
|
||||
$json = $this->appConfig->getValueString('core', $key, '', lazy: in_array($key, \OCP\TaskProcessing\IManager::LAZY_CONFIG_KEYS, true));
|
||||
$json = $this->appConfig->getValueString('core', $key, '', lazy: in_array($key, \OC\TaskProcessing\Manager::LAZY_CONFIG_KEYS, true));
|
||||
if ($json !== '') {
|
||||
try {
|
||||
$value = json_decode($json, true, flags: JSON_THROW_ON_ERROR);
|
||||
|
|
|
|||
|
|
@ -73,6 +73,11 @@ class Manager implements IManager {
|
|||
public const LEGACY_PREFIX_TEXTTOIMAGE = 'legacy:TextToImage:';
|
||||
public const LEGACY_PREFIX_SPEECHTOTEXT = 'legacy:SpeechToText:';
|
||||
|
||||
public const LAZY_CONFIG_KEYS = [
|
||||
'ai.taskprocessing_type_preferences',
|
||||
'ai.taskprocessing_provider_preferences',
|
||||
];
|
||||
|
||||
/** @var list<IProvider>|null */
|
||||
private ?array $providers = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,16 +27,6 @@ use OCP\TaskProcessing\Exception\ValidationException;
|
|||
*/
|
||||
interface IManager {
|
||||
|
||||
/**
|
||||
* Task processing config keys that can be stored and loaded lazily
|
||||
*
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public const LAZY_CONFIG_KEYS = [
|
||||
'ai.taskprocessing_type_preferences',
|
||||
'ai.taskprocessing_provider_preferences',
|
||||
];
|
||||
|
||||
/**
|
||||
* @since 30.0.0
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue