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, }