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:
Julien Veyssier 2025-08-01 15:35:56 +02:00
parent f22f7311de
commit be7ef439cf
No known key found for this signature in database
GPG key ID: 4141FEE162030638
4 changed files with 7 additions and 12 deletions

View file

@ -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();

View file

@ -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);

View file

@ -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;

View file

@ -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
*/