From 41b7db0d41798a4651b151cc2fc0772cae768f6b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 27 Nov 2024 22:40:16 +0200 Subject: [PATCH 01/11] rearrange `SimpleCreatorPlugin` and add name attribute --- server/settings/simple_creators.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/server/settings/simple_creators.py b/server/settings/simple_creators.py index 49d11ab..083a328 100644 --- a/server/settings/simple_creators.py +++ b/server/settings/simple_creators.py @@ -1,13 +1,16 @@ +from pydantic import root_validator + from ayon_server.settings import BaseSettingsModel, SettingsField class SimpleCreatorPlugin(BaseSettingsModel): - _layout = "expanded" - product_type: str = SettingsField("", title="Product type") + + name: str = SettingsField(title="Name", disabled=True) + label: str = SettingsField("", title="Label") # TODO add placeholder identifier: str = SettingsField("", title="Identifier") - label: str = SettingsField("", title="Label") icon: str = SettingsField("", title="Icon") + product_type: str = SettingsField("", title="Product type") default_variants: list[str] = SettingsField( default_factory=list, title="Default Variants" @@ -39,6 +42,11 @@ class SimpleCreatorPlugin(BaseSettingsModel): title="Extensions" ) + @root_validator(pre=True) + def use_label_as_name(cls, values): + values['name'] = values['label'] + return values + DEFAULT_SIMPLE_CREATORS = [ { From 8a575cfe8f755b6164d442a25d53a3d5b5247274 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 27 Nov 2024 23:38:49 +0200 Subject: [PATCH 02/11] Make `IngestCSV` setting easier to read --- server/settings/creator_plugins.py | 38 ++++++++++++++---------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/server/settings/creator_plugins.py b/server/settings/creator_plugins.py index e337fd9..a618d06 100644 --- a/server/settings/creator_plugins.py +++ b/server/settings/creator_plugins.py @@ -35,6 +35,7 @@ class ColumnItemModel(BaseSettingsModel): asset is parsed from file names ('asset.mov', 'asset_v001.mov', 'my_asset_to_publish.mov')""" + _layout = "expanded" name: str = SettingsField( title="Name", default="" @@ -89,6 +90,7 @@ class RepresentationItemModel(BaseSettingsModel): ('asset.mov', 'asset_v001.mov', 'my_asset_to_publish.mov') """ + _layout = "expanded" name: str = SettingsField( title="Name", default="" @@ -134,7 +136,7 @@ def validate_unique_outputs(cls, value): class FolderTypeRegexItem(BaseSettingsModel): - _layout = "expanded" + _layout = "compact" regex: str = SettingsField("", title="Folder Regex") folder_type: str = SettingsField( "Folder", @@ -146,7 +148,7 @@ class FolderTypeRegexItem(BaseSettingsModel): class TaskTypeRegexItem(BaseSettingsModel): - _layout = "expanded" + _layout = "compact" regex: str = SettingsField("", title="Task Regex") task_type: str = SettingsField( "", @@ -164,7 +166,20 @@ class FolderCreationConfigModel(BaseSettingsModel): title="Enabled folder creation", default=False, ) - + folder_create_type: str = SettingsField( + "Folder", + title="Default Folder Type", + enum_resolver=folder_types_enum, + description=( + "Default folder type for new folder(s) creation."), + ) + task_create_type: str = SettingsField( + "", + title="Default Task Type", + enum_resolver=task_types_enum, + description=( + "Default task type for new task(s) creation."), + ) folder_type_regexes: list[FolderTypeRegexItem] = SettingsField( default_factory=FolderTypeRegexItem, description=( @@ -173,15 +188,6 @@ class FolderCreationConfigModel(BaseSettingsModel): " depending on their names." ) ) - - folder_create_type: str = SettingsField( - "Folder", - title="Default Folder Type", - enum_resolver=folder_types_enum, - description=( - "Default folder type for new folder(s) creation."), - ) - task_type_regexes: list[TaskTypeRegexItem] = SettingsField( default_factory=TaskTypeRegexItem, description=( @@ -191,14 +197,6 @@ class FolderCreationConfigModel(BaseSettingsModel): ) ) - task_create_type: str = SettingsField( - "", - title="Default Task Type", - enum_resolver=task_types_enum, - description=( - "Default task type for new task(s) creation."), - ) - class IngestCSVPluginModel(BaseSettingsModel): """Allows to publish multiple video files in one go.
Name of matching From ec9647c7cd70a70b1a3d115a849bb4cf7789ef06 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 28 Nov 2024 00:48:18 +0200 Subject: [PATCH 03/11] move `simple_creators` and `editorial_creators` to a better place and implement conversion --- .../plugins/create/create_editorial.py | 2 +- .../plugins/create/create_from_settings.py | 2 +- server/__init__.py | 20 ++++++++++- server/settings/__init__.py | 3 ++ server/settings/conversion.py | 34 +++++++++++++++++++ server/settings/creator_plugins.py | 19 +++++++++++ server/settings/main.py | 19 +---------- 7 files changed, 78 insertions(+), 21 deletions(-) create mode 100644 server/settings/conversion.py diff --git a/client/ayon_traypublisher/plugins/create/create_editorial.py b/client/ayon_traypublisher/plugins/create/create_editorial.py index e2cda49..40a6f1b 100644 --- a/client/ayon_traypublisher/plugins/create/create_editorial.py +++ b/client/ayon_traypublisher/plugins/create/create_editorial.py @@ -200,7 +200,7 @@ def __init__(self, *args, **kwargs): def apply_settings(self, project_settings): editorial_creators = deepcopy( - project_settings["traypublisher"]["editorial_creators"] + project_settings["traypublisher"]["create"]["editorial_creators"] ) creator_settings = editorial_creators.get(self.identifier) diff --git a/client/ayon_traypublisher/plugins/create/create_from_settings.py b/client/ayon_traypublisher/plugins/create/create_from_settings.py index 13cf92a..7dfe5ee 100644 --- a/client/ayon_traypublisher/plugins/create/create_from_settings.py +++ b/client/ayon_traypublisher/plugins/create/create_from_settings.py @@ -11,7 +11,7 @@ def initialize(): project_name = os.environ["AYON_PROJECT_NAME"] project_settings = get_project_settings(project_name) - simple_creators = project_settings["traypublisher"]["simple_creators"] + simple_creators = project_settings["traypublisher"]["create"]["simple_creators"] global_variables = globals() for item in simple_creators: diff --git a/server/__init__.py b/server/__init__.py index 830f325..3113cb9 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -1,6 +1,12 @@ +from typing import Any + from ayon_server.addons import BaseServerAddon -from .settings import TraypublisherSettings, DEFAULT_TRAYPUBLISHER_SETTING +from .settings import ( + TraypublisherSettings, + DEFAULT_TRAYPUBLISHER_SETTING, + convert_settings_overrides, +) class Traypublisher(BaseServerAddon): @@ -9,3 +15,15 @@ class Traypublisher(BaseServerAddon): async def get_default_settings(self): settings_model_cls = self.get_settings_model() return settings_model_cls(**DEFAULT_TRAYPUBLISHER_SETTING) + + async def convert_settings_overrides( + self, + source_version: str, + overrides: dict[str, Any], + ) -> dict[str, Any]: + convert_settings_overrides(source_version, overrides) + # Use super conversion + return await super().convert_settings_overrides( + source_version, overrides + ) + diff --git a/server/settings/__init__.py b/server/settings/__init__.py index bcf8bef..eddc54f 100644 --- a/server/settings/__init__.py +++ b/server/settings/__init__.py @@ -2,9 +2,12 @@ TraypublisherSettings, DEFAULT_TRAYPUBLISHER_SETTING, ) +from .conversion import convert_settings_overrides __all__ = ( "TraypublisherSettings", "DEFAULT_TRAYPUBLISHER_SETTING", + + "convert_settings_overrides", ) diff --git a/server/settings/conversion.py b/server/settings/conversion.py new file mode 100644 index 0000000..7de2d42 --- /dev/null +++ b/server/settings/conversion.py @@ -0,0 +1,34 @@ +from typing import Any + + +def _convert_simple_creators_0_2_9(overrides): + if "simple_creators" not in overrides: + return + + if overrides.get("create") is None: + overrides.update({ + "create": {} + }) + + overrides["create"]["simple_creators"] = overrides.pop("simple_creators") + + +def _convert_editorial_creators_0_2_9(overrides): + if "editorial_creators" not in overrides: + return + + if overrides.get("create") is None: + overrides.update({ + "create": {} + }) + + overrides["create"]["editorial_creators"] = overrides.pop("editorial_creators") + + +def convert_settings_overrides( + source_version: str, + overrides: dict[str, Any], +) -> dict[str, Any]: + _convert_simple_creators_0_2_9(overrides) + _convert_editorial_creators_0_2_9(overrides) + return overrides diff --git a/server/settings/creator_plugins.py b/server/settings/creator_plugins.py index a618d06..00bd600 100644 --- a/server/settings/creator_plugins.py +++ b/server/settings/creator_plugins.py @@ -8,6 +8,15 @@ from ayon_server.settings.validators import ensure_unique_names from ayon_server.exceptions import BadRequestException +from .simple_creators import ( + SimpleCreatorPlugin, + DEFAULT_SIMPLE_CREATORS, +) +from .editorial_creators import ( + TraypublisherEditorialCreatorPlugins, + DEFAULT_EDITORIAL_CREATORS, +) + class BatchMovieCreatorPlugin(BaseSettingsModel): """Allows to publish multiple video files in one go.
Name of matching @@ -229,13 +238,23 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel): title="Batch Movie Creator", default_factory=BatchMovieCreatorPlugin ) + editorial_creators: TraypublisherEditorialCreatorPlugins = SettingsField( + title="Editorial Creators", + default_factory=TraypublisherEditorialCreatorPlugins, + ) IngestCSV: IngestCSVPluginModel = SettingsField( title="Ingest CSV", default_factory=IngestCSVPluginModel ) + simple_creators: list[SimpleCreatorPlugin] = SettingsField( + title="Simple Create Plugins", + default_factory=SimpleCreatorPlugin, + ) DEFAULT_CREATORS = { + "simple_creators": DEFAULT_SIMPLE_CREATORS, + "editorial_creators": DEFAULT_EDITORIAL_CREATORS, "BatchMovieCreator": { "default_variants": [ "Main" diff --git a/server/settings/main.py b/server/settings/main.py index 760c529..6723993 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -1,14 +1,7 @@ from ayon_server.settings import BaseSettingsModel, SettingsField from .imageio import TrayPublisherImageIOModel -from .simple_creators import ( - SimpleCreatorPlugin, - DEFAULT_SIMPLE_CREATORS, -) -from .editorial_creators import ( - TraypublisherEditorialCreatorPlugins, - DEFAULT_EDITORIAL_CREATORS, -) + from .creator_plugins import ( TrayPublisherCreatePluginsModel, DEFAULT_CREATORS, @@ -25,14 +18,6 @@ class TraypublisherSettings(BaseSettingsModel): default_factory=TrayPublisherImageIOModel, title="Color Management (ImageIO)" ) - simple_creators: list[SimpleCreatorPlugin] = SettingsField( - title="Simple Create Plugins", - default_factory=SimpleCreatorPlugin, - ) - editorial_creators: TraypublisherEditorialCreatorPlugins = SettingsField( - title="Editorial Creators", - default_factory=TraypublisherEditorialCreatorPlugins, - ) create: TrayPublisherCreatePluginsModel = SettingsField( title="Create", default_factory=TrayPublisherCreatePluginsModel @@ -44,8 +29,6 @@ class TraypublisherSettings(BaseSettingsModel): DEFAULT_TRAYPUBLISHER_SETTING = { - "simple_creators": DEFAULT_SIMPLE_CREATORS, - "editorial_creators": DEFAULT_EDITORIAL_CREATORS, "create": DEFAULT_CREATORS, "publish": DEFAULT_PUBLISH_PLUGINS, } From 93ad280ae46c19312cf8f55b13a0f72f2db5192b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 28 Nov 2024 15:32:12 +0200 Subject: [PATCH 04/11] Enhance the layout of `Editorial simple creator` settings --- server/settings/editorial_creators.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/settings/editorial_creators.py b/server/settings/editorial_creators.py index d9f5e30..00d2123 100644 --- a/server/settings/editorial_creators.py +++ b/server/settings/editorial_creators.py @@ -6,13 +6,13 @@ class ClipNameTokenizerItem(BaseSettingsModel): - _layout = "expanded" + _layout = "compact" name: str = SettingsField("", title="Tokenizer name") regex: str = SettingsField("", title="Tokenizer regex") class ShotAddTasksItem(BaseSettingsModel): - _layout = "expanded" + _layout = "compact" name: str = SettingsField('', title="Key") task_type: str = SettingsField( title="Task type", @@ -37,6 +37,7 @@ class ShotRenameSubmodel(BaseSettingsModel): class TokenToParentConvertorItem(BaseSettingsModel): + _layout = "compact" # TODO - was 'type' must be renamed in code to `parent_type` parent_type: str = SettingsField( "Project", @@ -75,6 +76,7 @@ class ShotHierarchySubmodel(BaseSettingsModel): class ProductTypePresetItem(BaseSettingsModel): + _layout="compact" product_type: str = SettingsField("", title="Product type") # TODO add placeholder '< Inherited >' variant: str = SettingsField("", title="Variant") From 601c823bffbc13b57e6b6d0e5a6e4536132128c7 Mon Sep 17 00:00:00 2001 From: Mustafa Jafar Date: Thu, 28 Nov 2024 15:33:59 +0200 Subject: [PATCH 05/11] enhance _convert_editorial_creators_0_2_9 Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- server/settings/conversion.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/settings/conversion.py b/server/settings/conversion.py index 7de2d42..d8bd5f8 100644 --- a/server/settings/conversion.py +++ b/server/settings/conversion.py @@ -17,12 +17,8 @@ def _convert_editorial_creators_0_2_9(overrides): if "editorial_creators" not in overrides: return - if overrides.get("create") is None: - overrides.update({ - "create": {} - }) - - overrides["create"]["editorial_creators"] = overrides.pop("editorial_creators") + create_overrides = overrides.setdefault("create", {}) + create_overrides["editorial_creators"] = overrides.pop("editorial_creators") def convert_settings_overrides( From 85e048144b8ac3d5bb9ca800e0fcb0fcc777e326 Mon Sep 17 00:00:00 2001 From: Mustafa Jafar Date: Thu, 28 Nov 2024 15:34:15 +0200 Subject: [PATCH 06/11] enhance _convert_simple_creators_0_2_9 Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- server/settings/conversion.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/settings/conversion.py b/server/settings/conversion.py index d8bd5f8..6cffd77 100644 --- a/server/settings/conversion.py +++ b/server/settings/conversion.py @@ -5,12 +5,8 @@ def _convert_simple_creators_0_2_9(overrides): if "simple_creators" not in overrides: return - if overrides.get("create") is None: - overrides.update({ - "create": {} - }) - - overrides["create"]["simple_creators"] = overrides.pop("simple_creators") + create_overrides = overrides.setdefault("create", {}) + create_overrides["simple_creators"] = overrides.pop("simple_creators") def _convert_editorial_creators_0_2_9(overrides): From b7dbe8b6f9534cda27e00d39d98bab228e3c3b4b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 28 Nov 2024 15:39:39 +0200 Subject: [PATCH 07/11] re-arrange create plugins --- server/settings/creator_plugins.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/settings/creator_plugins.py b/server/settings/creator_plugins.py index 00bd600..1c853a1 100644 --- a/server/settings/creator_plugins.py +++ b/server/settings/creator_plugins.py @@ -234,22 +234,22 @@ class IngestCSVPluginModel(BaseSettingsModel): class TrayPublisherCreatePluginsModel(BaseSettingsModel): - BatchMovieCreator: BatchMovieCreatorPlugin = SettingsField( - title="Batch Movie Creator", - default_factory=BatchMovieCreatorPlugin + simple_creators: list[SimpleCreatorPlugin] = SettingsField( + title="Simple Create Plugins", + default_factory=SimpleCreatorPlugin, ) editorial_creators: TraypublisherEditorialCreatorPlugins = SettingsField( title="Editorial Creators", default_factory=TraypublisherEditorialCreatorPlugins, ) + BatchMovieCreator: BatchMovieCreatorPlugin = SettingsField( + title="Batch Movie Creator", + default_factory=BatchMovieCreatorPlugin + ) IngestCSV: IngestCSVPluginModel = SettingsField( title="Ingest CSV", default_factory=IngestCSVPluginModel ) - simple_creators: list[SimpleCreatorPlugin] = SettingsField( - title="Simple Create Plugins", - default_factory=SimpleCreatorPlugin, - ) DEFAULT_CREATORS = { From 2b496aa910cd3d1fb4a9543bdfbb86bb2df25069 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 2 Dec 2024 16:01:01 +0200 Subject: [PATCH 08/11] revert changes in `FolderCreationConfigModel` and enhance it with section argument --- server/settings/creator_plugins.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/server/settings/creator_plugins.py b/server/settings/creator_plugins.py index 1c853a1..3631041 100644 --- a/server/settings/creator_plugins.py +++ b/server/settings/creator_plugins.py @@ -181,13 +181,7 @@ class FolderCreationConfigModel(BaseSettingsModel): enum_resolver=folder_types_enum, description=( "Default folder type for new folder(s) creation."), - ) - task_create_type: str = SettingsField( - "", - title="Default Task Type", - enum_resolver=task_types_enum, - description=( - "Default task type for new task(s) creation."), + section="Folder Settings" ) folder_type_regexes: list[FolderTypeRegexItem] = SettingsField( default_factory=FolderTypeRegexItem, @@ -197,6 +191,14 @@ class FolderCreationConfigModel(BaseSettingsModel): " depending on their names." ) ) + task_create_type: str = SettingsField( + "", + title="Default Task Type", + enum_resolver=task_types_enum, + description=( + "Default task type for new task(s) creation."), + section="Task Settings" + ) task_type_regexes: list[TaskTypeRegexItem] = SettingsField( default_factory=TaskTypeRegexItem, description=( From ef8c275bb8ce75ddedd8d117cecbe3e0e70331c1 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 3 Dec 2024 12:08:12 +0200 Subject: [PATCH 09/11] revert changes in settings order in `SimpleCreatorPlugin` --- server/settings/simple_creators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/settings/simple_creators.py b/server/settings/simple_creators.py index 083a328..a4e097f 100644 --- a/server/settings/simple_creators.py +++ b/server/settings/simple_creators.py @@ -6,11 +6,11 @@ class SimpleCreatorPlugin(BaseSettingsModel): name: str = SettingsField(title="Name", disabled=True) - label: str = SettingsField("", title="Label") + product_type: str = SettingsField("", title="Product type") # TODO add placeholder identifier: str = SettingsField("", title="Identifier") + label: str = SettingsField("", title="Label") icon: str = SettingsField("", title="Icon") - product_type: str = SettingsField("", title="Product type") default_variants: list[str] = SettingsField( default_factory=list, title="Default Variants" @@ -44,7 +44,7 @@ class SimpleCreatorPlugin(BaseSettingsModel): @root_validator(pre=True) def use_label_as_name(cls, values): - values['name'] = values['label'] + values['name'] = values['product_type'] return values From 03df7b381548c5ca73b89700da93f3e833b6e9a1 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 3 Dec 2024 14:30:25 +0200 Subject: [PATCH 10/11] revert adding `name` to `SimpleCreatorPlugin` --- server/settings/simple_creators.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/server/settings/simple_creators.py b/server/settings/simple_creators.py index a4e097f..9c822de 100644 --- a/server/settings/simple_creators.py +++ b/server/settings/simple_creators.py @@ -1,11 +1,8 @@ -from pydantic import root_validator - from ayon_server.settings import BaseSettingsModel, SettingsField class SimpleCreatorPlugin(BaseSettingsModel): - name: str = SettingsField(title="Name", disabled=True) product_type: str = SettingsField("", title="Product type") # TODO add placeholder identifier: str = SettingsField("", title="Identifier") @@ -42,11 +39,6 @@ class SimpleCreatorPlugin(BaseSettingsModel): title="Extensions" ) - @root_validator(pre=True) - def use_label_as_name(cls, values): - values['name'] = values['product_type'] - return values - DEFAULT_SIMPLE_CREATORS = [ { From 825ff1551badf446231045ccf954dc11f605c3ce Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 3 Dec 2024 15:10:05 +0200 Subject: [PATCH 11/11] revert moving `Simple Create Plugins` and `Editorial Creators` --- .../plugins/create/create_editorial.py | 2 +- .../plugins/create/create_from_settings.py | 2 +- server/__init__.py | 20 +------------- server/settings/__init__.py | 3 --- server/settings/conversion.py | 26 ------------------- server/settings/creator_plugins.py | 19 -------------- server/settings/main.py | 19 +++++++++++++- 7 files changed, 21 insertions(+), 70 deletions(-) delete mode 100644 server/settings/conversion.py diff --git a/client/ayon_traypublisher/plugins/create/create_editorial.py b/client/ayon_traypublisher/plugins/create/create_editorial.py index 40a6f1b..e2cda49 100644 --- a/client/ayon_traypublisher/plugins/create/create_editorial.py +++ b/client/ayon_traypublisher/plugins/create/create_editorial.py @@ -200,7 +200,7 @@ def __init__(self, *args, **kwargs): def apply_settings(self, project_settings): editorial_creators = deepcopy( - project_settings["traypublisher"]["create"]["editorial_creators"] + project_settings["traypublisher"]["editorial_creators"] ) creator_settings = editorial_creators.get(self.identifier) diff --git a/client/ayon_traypublisher/plugins/create/create_from_settings.py b/client/ayon_traypublisher/plugins/create/create_from_settings.py index 7dfe5ee..13cf92a 100644 --- a/client/ayon_traypublisher/plugins/create/create_from_settings.py +++ b/client/ayon_traypublisher/plugins/create/create_from_settings.py @@ -11,7 +11,7 @@ def initialize(): project_name = os.environ["AYON_PROJECT_NAME"] project_settings = get_project_settings(project_name) - simple_creators = project_settings["traypublisher"]["create"]["simple_creators"] + simple_creators = project_settings["traypublisher"]["simple_creators"] global_variables = globals() for item in simple_creators: diff --git a/server/__init__.py b/server/__init__.py index 3113cb9..830f325 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -1,12 +1,6 @@ -from typing import Any - from ayon_server.addons import BaseServerAddon -from .settings import ( - TraypublisherSettings, - DEFAULT_TRAYPUBLISHER_SETTING, - convert_settings_overrides, -) +from .settings import TraypublisherSettings, DEFAULT_TRAYPUBLISHER_SETTING class Traypublisher(BaseServerAddon): @@ -15,15 +9,3 @@ class Traypublisher(BaseServerAddon): async def get_default_settings(self): settings_model_cls = self.get_settings_model() return settings_model_cls(**DEFAULT_TRAYPUBLISHER_SETTING) - - async def convert_settings_overrides( - self, - source_version: str, - overrides: dict[str, Any], - ) -> dict[str, Any]: - convert_settings_overrides(source_version, overrides) - # Use super conversion - return await super().convert_settings_overrides( - source_version, overrides - ) - diff --git a/server/settings/__init__.py b/server/settings/__init__.py index eddc54f..bcf8bef 100644 --- a/server/settings/__init__.py +++ b/server/settings/__init__.py @@ -2,12 +2,9 @@ TraypublisherSettings, DEFAULT_TRAYPUBLISHER_SETTING, ) -from .conversion import convert_settings_overrides __all__ = ( "TraypublisherSettings", "DEFAULT_TRAYPUBLISHER_SETTING", - - "convert_settings_overrides", ) diff --git a/server/settings/conversion.py b/server/settings/conversion.py deleted file mode 100644 index 6cffd77..0000000 --- a/server/settings/conversion.py +++ /dev/null @@ -1,26 +0,0 @@ -from typing import Any - - -def _convert_simple_creators_0_2_9(overrides): - if "simple_creators" not in overrides: - return - - create_overrides = overrides.setdefault("create", {}) - create_overrides["simple_creators"] = overrides.pop("simple_creators") - - -def _convert_editorial_creators_0_2_9(overrides): - if "editorial_creators" not in overrides: - return - - create_overrides = overrides.setdefault("create", {}) - create_overrides["editorial_creators"] = overrides.pop("editorial_creators") - - -def convert_settings_overrides( - source_version: str, - overrides: dict[str, Any], -) -> dict[str, Any]: - _convert_simple_creators_0_2_9(overrides) - _convert_editorial_creators_0_2_9(overrides) - return overrides diff --git a/server/settings/creator_plugins.py b/server/settings/creator_plugins.py index 3631041..e7c725f 100644 --- a/server/settings/creator_plugins.py +++ b/server/settings/creator_plugins.py @@ -8,15 +8,6 @@ from ayon_server.settings.validators import ensure_unique_names from ayon_server.exceptions import BadRequestException -from .simple_creators import ( - SimpleCreatorPlugin, - DEFAULT_SIMPLE_CREATORS, -) -from .editorial_creators import ( - TraypublisherEditorialCreatorPlugins, - DEFAULT_EDITORIAL_CREATORS, -) - class BatchMovieCreatorPlugin(BaseSettingsModel): """Allows to publish multiple video files in one go.
Name of matching @@ -236,14 +227,6 @@ class IngestCSVPluginModel(BaseSettingsModel): class TrayPublisherCreatePluginsModel(BaseSettingsModel): - simple_creators: list[SimpleCreatorPlugin] = SettingsField( - title="Simple Create Plugins", - default_factory=SimpleCreatorPlugin, - ) - editorial_creators: TraypublisherEditorialCreatorPlugins = SettingsField( - title="Editorial Creators", - default_factory=TraypublisherEditorialCreatorPlugins, - ) BatchMovieCreator: BatchMovieCreatorPlugin = SettingsField( title="Batch Movie Creator", default_factory=BatchMovieCreatorPlugin @@ -255,8 +238,6 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel): DEFAULT_CREATORS = { - "simple_creators": DEFAULT_SIMPLE_CREATORS, - "editorial_creators": DEFAULT_EDITORIAL_CREATORS, "BatchMovieCreator": { "default_variants": [ "Main" diff --git a/server/settings/main.py b/server/settings/main.py index 6723993..760c529 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -1,7 +1,14 @@ from ayon_server.settings import BaseSettingsModel, SettingsField from .imageio import TrayPublisherImageIOModel - +from .simple_creators import ( + SimpleCreatorPlugin, + DEFAULT_SIMPLE_CREATORS, +) +from .editorial_creators import ( + TraypublisherEditorialCreatorPlugins, + DEFAULT_EDITORIAL_CREATORS, +) from .creator_plugins import ( TrayPublisherCreatePluginsModel, DEFAULT_CREATORS, @@ -18,6 +25,14 @@ class TraypublisherSettings(BaseSettingsModel): default_factory=TrayPublisherImageIOModel, title="Color Management (ImageIO)" ) + simple_creators: list[SimpleCreatorPlugin] = SettingsField( + title="Simple Create Plugins", + default_factory=SimpleCreatorPlugin, + ) + editorial_creators: TraypublisherEditorialCreatorPlugins = SettingsField( + title="Editorial Creators", + default_factory=TraypublisherEditorialCreatorPlugins, + ) create: TrayPublisherCreatePluginsModel = SettingsField( title="Create", default_factory=TrayPublisherCreatePluginsModel @@ -29,6 +44,8 @@ class TraypublisherSettings(BaseSettingsModel): DEFAULT_TRAYPUBLISHER_SETTING = { + "simple_creators": DEFAULT_SIMPLE_CREATORS, + "editorial_creators": DEFAULT_EDITORIAL_CREATORS, "create": DEFAULT_CREATORS, "publish": DEFAULT_PUBLISH_PLUGINS, }