mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Deadline: correct webservice couldn't be selected in Ayon (#6007)
* Refactor necessary for Ayon changes in Setting model * Removed unnecessary configuration MongoDB is not a thing in Ayon. * Changed DL model to use dynamic enum Enum values are set in Studio Settings, in Project settings will be selected from. Used this way to be close to OP variant and support both until OP is deprecated. * Hound * Refactor with use of AYON_SERVER_ENABLED This will make it simpler to remove obsolete code in the future. --------- Co-authored-by: Libor Batek <112623825+LiborBatek@users.noreply.github.com>
This commit is contained in:
parent
0ed8a66fb8
commit
f9509f3613
3 changed files with 43 additions and 35 deletions
|
|
@ -14,15 +14,35 @@ class ServerListSubmodel(BaseSettingsModel):
|
|||
value: str = Field(title="Value")
|
||||
|
||||
|
||||
async def defined_deadline_ws_name_enum_resolver(
|
||||
addon: "BaseServerAddon",
|
||||
settings_variant: str = "production",
|
||||
project_name: str | None = None,
|
||||
) -> list[str]:
|
||||
"""Provides list of names of configured Deadline webservice urls."""
|
||||
if addon is None:
|
||||
return []
|
||||
|
||||
settings = await addon.get_studio_settings(variant=settings_variant)
|
||||
|
||||
ws_urls = []
|
||||
for deadline_url_item in settings.deadline_urls:
|
||||
ws_urls.append(deadline_url_item.name)
|
||||
|
||||
return ws_urls
|
||||
|
||||
|
||||
class DeadlineSettings(BaseSettingsModel):
|
||||
deadline_urls: list[ServerListSubmodel] = Field(
|
||||
default_factory=list,
|
||||
title="System Deadline Webservice URLs",
|
||||
scope=["studio"],
|
||||
)
|
||||
deadline_servers: list[str] = Field(
|
||||
title="Project deadline servers",
|
||||
deadline_server: str = Field(
|
||||
title="Project deadline server",
|
||||
section="---",
|
||||
scope=["project"],
|
||||
enum_resolver=defined_deadline_ws_name_enum_resolver
|
||||
)
|
||||
publish: PublishPluginsModel = Field(
|
||||
default_factory=PublishPluginsModel,
|
||||
|
|
@ -42,7 +62,6 @@ DEFAULT_VALUES = {
|
|||
"value": "http://127.0.0.1:8082"
|
||||
}
|
||||
],
|
||||
# TODO: this needs to be dynamic from "deadline_urls"
|
||||
"deadline_servers": [],
|
||||
"deadline_server": "default",
|
||||
"publish": DEFAULT_DEADLINE_PLUGINS_SETTINGS
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue