fix(config): ensure fallback to cfg when apiPluginConfig has no image/video property
This commit is contained in:
1 parent
7472270e1f
commit
b612af1c38
4 files changed
+12
-12
No files matched your search
+3
-4
@@ -69,10 +69,9 @@ export function resolveImageConfig(
|
||||
cfg: ImageGenerationRequest["cfg"] | undefined,
|
||||
apiPluginConfig?: Record<string, unknown>,
|
||||
): ImagePluginConfig | undefined {
|
||||
const config = (apiPluginConfig ?? cfg?.plugins?.entries?.["1h-tools"]?.config) as
|
||||
| { image?: ImagePluginConfig }
|
||||
| undefined;
|
||||
return config?.image;
|
||||
const direct = apiPluginConfig?.image as ImagePluginConfig | undefined;
|
||||
const fromCfg = cfg?.plugins?.entries?.["1h-tools"]?.config?.image as ImagePluginConfig | undefined;
|
||||
return direct ?? fromCfg;
|
||||
}
|
||||
|
||||
export function resolveConfiguredImageBaseUrl(
|
||||
|
||||
Reference in new issue
Block a user