Added better constraints checks with more to follow.

This commit is contained in:
Abdulmhsen B. A. A
2024-05-17 22:48:34 +03:00
parent dafeb49465
commit 126b0600d1
8 changed files with 195 additions and 102 deletions

View File

@@ -1,37 +0,0 @@
<?php
/**
* Last update: 2024-04-26
*
* servers.yaml backend spec.
* This file defines the backend spec.
* The dot (.) notation means the key is subarray of the parent key.
* the boolean at the end of the key means if the key should be visible in the config:edit/view command.
*/
return [
'name' => true,
'type' => true,
'url' => true,
'token' => true,
'uuid' => true,
'user' => true,
'export.enabled' => true,
'export.lastSync' => true,
'import.enabled' => true,
'import.lastSync' => true,
'webhook.token' => true,
'webhook.match.user' => true,
'webhook.match.uuid' => true,
'options.ignore' => true,
'options.LIBRARY_SEGMENT' => true,
'options.ADMIN_TOKEN' => false,
'options.DUMP_PAYLOAD' => false,
'options.DEBUG_TRACE' => false,
'options.IMPORT_METADATA_ONLY' => false,
'options.DRY_RUN' => false,
'options.client.timeout' => false,
'options.client.http_version' => false,
'options.use_old_progress_endpoint' => false,
'options.MAX_EPISODE_RANGE' => false,
];

View File

@@ -1,7 +1,7 @@
<?php
/**
* Last update: 2024-05-14
* Last update: 2024-05-17
*
* servers.yaml backend spec.
*
@@ -14,13 +14,15 @@ return [
'type' => 'string',
'visible' => true,
'description' => 'The name of the backend.',
'immutable' => true,
],
[
'key' => 'type',
'type' => 'string',
'visible' => true,
'description' => 'The type of the backend.',
'choices' => ['plex', 'emby', 'jellyfin']
'choices' => ['plex', 'emby', 'jellyfin'],
'immutable' => true,
],
[
'key' => 'url',
@@ -54,7 +56,7 @@ return [
],
[
'key' => 'export.lastSync',
'type' => 'integer',
'type' => 'int',
'visible' => true,
'description' => 'The last time data was exported to the backend.',
],
@@ -66,7 +68,7 @@ return [
],
[
'key' => 'import.lastSync',
'type' => 'integer',
'type' => 'int',
'visible' => true,
'description' => 'The last time data was imported from the backend.',
],
@@ -139,7 +141,7 @@ return [
],
[
'key' => 'options.client.timeout',
'type' => 'integer',
'type' => 'int',
'visible' => false,
'description' => 'The http timeout per request to the backend.',
],