diff --git a/api/api_specification.json b/api/api_specification.json index 5e4a0d80edca959982241d082fdca06a6fea1d1c..c9dc81f5c6959f6e483f60992de67b7e44268038 100644 --- a/api/api_specification.json +++ b/api/api_specification.json @@ -3057,7 +3057,17 @@ "type": "int" } }, - "media_process": {}, + "media_process": { + "may_be_null": { + "config_directly_modifiable": false, + "id": "may_be_null", + "notes": "", + "object_variant": "media_process", + "only_mod": false, + "optional": false, + "type": "boolean" + } + }, "object": { "may_be_null": { "config_directly_modifiable": false, diff --git a/api/api_specification.md b/api/api_specification.md index 26849cea989d8b17b43a30ad4c21ae51771ed6bb..b26b976cd71054746922392a2aaadfd1a1f3a220 100644 --- a/api/api_specification.md +++ b/api/api_specification.md @@ -1,4 +1,4 @@ -# Specification of the Web API for the Video-AG Website (v0.79). +# Specification of the Web API for the Video-AG Website (v0.80). ## Introduction @@ -2262,7 +2262,12 @@ Additionally, the following objects may appear as the type of some field: <td>?int</td> <td></td> </tr> - <tr><td><code>media_process</code></td></tr> + <tr> + <td rowspan="1"><code>media_process</code></td> + <td>may_be_null</td> + <td>boolean</td> + <td></td> + </tr> <tr> <td rowspan="2"><code>object</code></td> <td>may_be_null</td> @@ -3183,6 +3188,11 @@ Possible `error_code`: ## Changelog +### v0.80 + +* Updated `field_description` + * Added `may_be_null` for type `media_process` + ### 0.79 * Added `POST /job/status` diff --git a/api/api_specification_template.md b/api/api_specification_template.md index b0ae25c32d33cfeb89f1bafcb7b89b948a529553..2098757462a0a1311a039a4ac16a51e9938a292b 100644 --- a/api/api_specification_template.md +++ b/api/api_specification_template.md @@ -1,4 +1,4 @@ -# Specification of the Web API for the Video-AG Website (v0.79). +# Specification of the Web API for the Video-AG Website (v0.80). ## Introduction @@ -139,6 +139,11 @@ Possible `error_code`: ## Changelog +### v0.80 + +* Updated `field_description` + * Added `may_be_null` for type `media_process` + ### 0.79 * Added `POST /job/status` diff --git a/common_py/src/videoag_common/media_process/media_process.py b/common_py/src/videoag_common/media_process/media_process.py index 354a9489626810b2eae54f5e3133387eac8cc908..debcf5de2d2f5588244673ced6a288decaa81dfb 100644 --- a/common_py/src/videoag_common/media_process/media_process.py +++ b/common_py/src/videoag_common/media_process/media_process.py @@ -1,5 +1,5 @@ from collections.abc import Iterable -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from videoag_common.miscellaneous import * from videoag_common.database import * @@ -99,11 +99,19 @@ class MediaProcess(JsonDataClass): return self._hash +class MediaProcessFieldDescription(ApiFieldDescription): + may_be_null: bool + + @classmethod + def get_type(cls) -> str: + return "media_process" + + class ApiMediaProcessField[_O: ApiObject](ApiSimpleColumnField[_O]): @classmethod def _get_description_class_or_type(cls) -> ApiFieldDescription or str: - return "media_process" + return MediaProcessFieldDescription def post_init_check(self, context: FieldContext): super().post_init_check(context) @@ -114,6 +122,11 @@ class ApiMediaProcessField[_O: ApiObject](ApiSimpleColumnField[_O]): @property def may_be_none_allowed_for_config_fields(self) -> bool: return True + + def _config_get_description_kwargs(self) -> dict[str, Any]: + return super()._config_get_description_kwargs() | { + "may_be_null": self.may_be_none + } def _db_value_to_json(self, db_value) -> JsonTypes: return db_value