> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jakan.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration Operations

> Operations for managing Stash configuration and settings.

Operations for managing Stash configuration and settings.

Bases: `StashClientProtocol`

Mixin for configuration methods.

## Functions

### configure\_general

```python theme={null}
configure_general(
    input_data: ConfigGeneralInput | dict[str, Any],
) -> ConfigGeneralResult
```

Configure general Stash settings.

Parameters:

| Name         | Type                                   | Description                                                         | Default    |
| ------------ | -------------------------------------- | ------------------------------------------------------------------- | ---------- |
| `input_data` | `ConfigGeneralInput \| dict[str, Any]` | ConfigGeneralInput object or dictionary containing general settings | *required* |

Returns:

| Type                  | Description                                    |
| --------------------- | ---------------------------------------------- |
| `ConfigGeneralResult` | ConfigGeneralResult with updated configuration |

Examples:

Configure database path:

```python theme={null}
config = await client.configure_general({
    "databasePath": "/path/to/database.db"
})
print(f"Database path: {config.database_path}")
```

Using the input type:

```python theme={null}
from stash_graphql_client.types import ConfigGeneralInput

input_data = ConfigGeneralInput(
    databasePath="/path/to/database.db",
    generatedPath="/path/to/generated"
)
config = await client.configure_general(input_data)
```

### configure\_interface

```python theme={null}
configure_interface(
    input_data: ConfigInterfaceInput | dict[str, Any],
) -> ConfigInterfaceResult
```

Configure Stash interface settings.

Parameters:

| Name         | Type                                     | Description                                                             | Default    |
| ------------ | ---------------------------------------- | ----------------------------------------------------------------------- | ---------- |
| `input_data` | `ConfigInterfaceInput \| dict[str, Any]` | ConfigInterfaceInput object or dictionary containing interface settings | *required* |

Returns:

| Type                    | Description                                      |
| ----------------------- | ------------------------------------------------ |
| `ConfigInterfaceResult` | ConfigInterfaceResult with updated configuration |

Examples:

Configure interface options:

```python theme={null}
config = await client.configure_interface({
    "soundOnPreview": True,
    "wallShowTitle": False
})
```

Using the input type:

```python theme={null}
from stash_graphql_client.types import ConfigInterfaceInput

input_data = ConfigInterfaceInput(
    soundOnPreview=True,
    wallShowTitle=False,
    autostartVideo=True
)
config = await client.configure_interface(input_data)
```

### configure\_dlna

```python theme={null}
configure_dlna(
    input_data: ConfigDLNAInput | dict[str, Any],
) -> ConfigDLNAResult
```

Configure DLNA server settings.

Parameters:

| Name         | Type                                | Description                                                   | Default    |
| ------------ | ----------------------------------- | ------------------------------------------------------------- | ---------- |
| `input_data` | `ConfigDLNAInput \| dict[str, Any]` | ConfigDLNAInput object or dictionary containing DLNA settings | *required* |

Returns:

| Type               | Description                                 |
| ------------------ | ------------------------------------------- |
| `ConfigDLNAResult` | ConfigDLNAResult with updated configuration |

Examples:

Enable DLNA server:

```python theme={null}
config = await client.configure_dlna({
    "enabled": True,
    "port": 1338,
    "serverName": "Stash DLNA"
})
print(f"DLNA enabled: {config.enabled}")
```

Using the input type:

```python theme={null}
from stash_graphql_client.types import ConfigDLNAInput

input_data = ConfigDLNAInput(
    enabled=True,
    port=1338,
    serverName="Stash DLNA",
    whitelistedIPs=["192.168.1.0/24"]
)
config = await client.configure_dlna(input_data)
```

### configure\_defaults

```python theme={null}
configure_defaults(
    input_data: ConfigDefaultSettingsInput | dict[str, Any],
) -> ConfigDefaultSettingsResult
```

Configure default metadata operation settings.

Parameters:

| Name         | Type                                           | Description                                                                 | Default    |
| ------------ | ---------------------------------------------- | --------------------------------------------------------------------------- | ---------- |
| `input_data` | `ConfigDefaultSettingsInput \| dict[str, Any]` | ConfigDefaultSettingsInput object or dictionary containing default settings | *required* |

Returns:

| Type                          | Description                                            |
| ----------------------------- | ------------------------------------------------------ |
| `ConfigDefaultSettingsResult` | ConfigDefaultSettingsResult with updated configuration |

Examples:

Configure default delete behavior:

```python theme={null}
config = await client.configure_defaults({
    "deleteFile": False,
    "deleteGenerated": True
})
```

Using the input type:

```python theme={null}
from stash_graphql_client.types import ConfigDefaultSettingsInput

input_data = ConfigDefaultSettingsInput(
    deleteFile=False,
    deleteGenerated=True
)
config = await client.configure_defaults(input_data)
```

### configure\_ui

```python theme={null}
configure_ui(
    input_data: dict[str, Any] | None = None,
    partial: dict[str, Any] | None = None,
) -> dict[str, Any]
```

Configure UI settings.

Parameters:

| Name         | Type                     | Description                                     | Default |
| ------------ | ------------------------ | ----------------------------------------------- | ------- |
| `input_data` | `dict[str, Any] \| None` | Complete UI configuration dictionary (optional) | `None`  |
| `partial`    | `dict[str, Any] \| None` | Partial UI configuration to merge (optional)    | `None`  |

Returns:

| Type             | Description                         |
| ---------------- | ----------------------------------- |
| `dict[str, Any]` | Updated UI configuration dictionary |

Examples:

Update UI configuration:

```python theme={null}
config = await client.configure_ui(
    partial={"theme": "dark", "language": "en-US"}
)
```

Replace entire UI config:

```python theme={null}
config = await client.configure_ui(
    input_data={"theme": "dark", "language": "en-US"}
)
```

### configure\_ui\_setting

```python theme={null}
configure_ui_setting(
    key: str, value: Any
) -> dict[str, Any]
```

Configure a single UI setting.

Parameters:

| Name    | Type  | Description               | Default    |
| ------- | ----- | ------------------------- | ---------- |
| `key`   | `str` | Setting key to update     | *required* |
| `value` | `Any` | New value for the setting | *required* |

Returns:

| Type             | Description                         |
| ---------------- | ----------------------------------- |
| `dict[str, Any]` | Updated UI configuration dictionary |

Examples:

Update a single UI setting:

```python theme={null}
config = await client.configure_ui_setting("theme", "dark")
```

Update multiple settings one at a time:

```python theme={null}
await client.configure_ui_setting("theme", "dark")
await client.configure_ui_setting("language", "en-US")
```

### generate\_api\_key

```python theme={null}
generate_api_key(
    input_data: GenerateAPIKeyInput | dict[str, Any],
) -> str
```

Generate a new API key.

Parameters:

| Name         | Type                                    | Description                               | Default    |
| ------------ | --------------------------------------- | ----------------------------------------- | ---------- |
| `input_data` | `GenerateAPIKeyInput \| dict[str, Any]` | GenerateAPIKeyInput object or dictionary. | *required* |

Returns:

| Type  | Description              |
| ----- | ------------------------ |
| `str` | Generated API key string |

Examples:

Generate new API key:

```python theme={null}
api_key = await client.generate_api_key({"clear": False})
print(f"New API key: {api_key}")
```

Clear and generate new key:

```python theme={null}
from stash_graphql_client.types import GenerateAPIKeyInput

input_data = GenerateAPIKeyInput(clear=True)
api_key = await client.generate_api_key(input_data)
```

### find\_saved\_filter

```python theme={null}
find_saved_filter(id: str) -> SavedFilter | None
```

Find a saved filter by ID.

Parameters:

| Name | Type  | Description | Default    |
| ---- | ----- | ----------- | ---------- |
| `id` | `str` | Filter ID   | *required* |

Returns:

| Type                  | Description                                 |
| --------------------- | ------------------------------------------- |
| `SavedFilter \| None` | SavedFilter object if found, None otherwise |

### find\_saved\_filters

```python theme={null}
find_saved_filters(
    mode: FilterMode | None = None,
) -> list[SavedFilter]
```

Find all saved filters, optionally filtered by mode.

Parameters:

| Name   | Type                 | Description                       | Default |
| ------ | -------------------- | --------------------------------- | ------- |
| `mode` | `FilterMode \| None` | Optional filter mode to filter by | `None`  |

Returns:

| Type                | Description                 |
| ------------------- | --------------------------- |
| `list[SavedFilter]` | List of SavedFilter objects |

### configure\_scraping

```python theme={null}
configure_scraping(
    input_data: ConfigScrapingInput | dict[str, Any],
) -> ConfigScrapingResult
```

Configure scraping settings.

Parameters:

| Name         | Type                                    | Description                              | Default    |
| ------------ | --------------------------------------- | ---------------------------------------- | ---------- |
| `input_data` | `ConfigScrapingInput \| dict[str, Any]` | ConfigScrapingInput object or dictionary | *required* |

Returns:

| Type                   | Description                                     |
| ---------------------- | ----------------------------------------------- |
| `ConfigScrapingResult` | ConfigScrapingResult with updated configuration |

### validate\_stashbox\_credentials

```python theme={null}
validate_stashbox_credentials(
    input_data: StashBoxInput | dict[str, Any],
) -> StashBoxValidationResult
```

Validate StashBox credentials.

Parameters:

| Name         | Type                              | Description                         | Default    |
| ------------ | --------------------------------- | ----------------------------------- | ---------- |
| `input_data` | `StashBoxInput \| dict[str, Any]` | StashBoxInput object or dictionary. | *required* |

Returns:

| Type                       | Description                                     |
| -------------------------- | ----------------------------------------------- |
| `StashBoxValidationResult` | StashBoxValidationResult with validation status |

### enable\_dlna

```python theme={null}
enable_dlna(
    input_data: EnableDLNAInput | dict[str, Any],
) -> bool
```

Enable DLNA server.

Parameters:

| Name         | Type                                | Description                          | Default    |
| ------------ | ----------------------------------- | ------------------------------------ | ---------- |
| `input_data` | `EnableDLNAInput \| dict[str, Any]` | EnableDLNAInput object or dictionary | *required* |

Returns:

| Type   | Description        |
| ------ | ------------------ |
| `bool` | True if successful |

### disable\_dlna

```python theme={null}
disable_dlna(
    input_data: DisableDLNAInput | dict[str, Any],
) -> bool
```

Disable DLNA server.

Parameters:

| Name         | Type                                 | Description                           | Default    |
| ------------ | ------------------------------------ | ------------------------------------- | ---------- |
| `input_data` | `DisableDLNAInput \| dict[str, Any]` | DisableDLNAInput object or dictionary | *required* |

Returns:

| Type   | Description        |
| ------ | ------------------ |
| `bool` | True if successful |

### add\_temp\_dlna\_ip

```python theme={null}
add_temp_dlna_ip(
    input_data: AddTempDLNAIPInput | dict[str, Any],
) -> bool
```

Add temporary DLNA IP whitelist.

Parameters:

| Name         | Type                                   | Description                             | Default    |
| ------------ | -------------------------------------- | --------------------------------------- | ---------- |
| `input_data` | `AddTempDLNAIPInput \| dict[str, Any]` | AddTempDLNAIPInput object or dictionary | *required* |

Returns:

| Type   | Description        |
| ------ | ------------------ |
| `bool` | True if successful |

### remove\_temp\_dlna\_ip

```python theme={null}
remove_temp_dlna_ip(
    input_data: RemoveTempDLNAIPInput | dict[str, Any],
) -> bool
```

Remove temporary DLNA IP from whitelist.

Parameters:

| Name         | Type                                      | Description                                | Default    |
| ------------ | ----------------------------------------- | ------------------------------------------ | ---------- |
| `input_data` | `RemoveTempDLNAIPInput \| dict[str, Any]` | RemoveTempDLNAIPInput object or dictionary | *required* |

Returns:

| Type   | Description        |
| ------ | ------------------ |
| `bool` | True if successful |

### get\_configuration

```python theme={null}
get_configuration() -> ConfigResult
```

Get complete Stash configuration.

Returns:

| Type           | Description                                          |
| -------------- | ---------------------------------------------------- |
| `ConfigResult` | ConfigResult with all server configuration sections. |

Raises:

| Type             | Description                  |
| ---------------- | ---------------------------- |
| `TransportError` | If the GraphQL request fails |

Examples:

Get full configuration:

```python theme={null}
config = await client.get_configuration()
print(f"Database: {config.general.database_path}")
print(f"Language: {config.interface.language}")
print(f"DLNA enabled: {config.dlna.enabled}")
```

Check specific settings:

```python theme={null}
config = await client.get_configuration()
if config.general.parallel_tasks < 4:
    print("Consider increasing parallel tasks for better performance")

if not config.scraping.scraper_cert_check:
    print("WARNING: SSL certificate checking is disabled!")
```

Inspect plugin configurations:

```python theme={null}
config = await client.get_configuration()
if config.plugins:
    for plugin_id, settings in config.plugins.items():
        print(f"Plugin {plugin_id}: {settings}")
```
