Skip to main content
Operations for scanning, generating, and managing metadata. Bases: StashClientProtocol Mixin for metadata and database operation methods.

Functions

metadata_generate

Generate metadata. Parameters: Returns: Raises:

metadata_scan

Start a metadata scan job. Parameters: Returns:

get_configuration_defaults

Get default configuration settings.

metadata_clean

Clean metadata and remove orphaned database entries. Parameters: Returns: Examples: Clean all metadata:
Dry run to see what would be cleaned:
Clean specific paths:

metadata_clean_generated

Clean generated files (sprites, previews, screenshots, etc.). Parameters: Returns: Examples: Clean all generated files:
Dry run to see what would be cleaned:
Clean only specific types:

metadata_auto_tag

Start auto-tagging metadata task. Parameters: Returns: Examples: Auto-tag all files with all performers:
Auto-tag specific paths with specific performers:

metadata_identify

Start metadata identification task using scrapers. Parameters: Returns: Examples: Identify scenes using a stash-box endpoint:
Identify with custom options:

metadata_import

Start full metadata import from metadata directory. This operation completely wipes the database and imports from the metadata directory. Use with caution. Returns: Examples: Start full metadata import:

metadata_export

Start full metadata export to metadata directory. Exports the entire database to the configured metadata directory. Returns: Examples: Start full metadata export:

export_objects

Export objects to a downloadable file. Parameters: Returns:

import_objects

Import objects from a file. Parameters: Returns: Examples: Import from file:
Import with duplicate handling:

backup_database

Create a database backup. Parameters: Returns: Examples: Create and download backup:
Create backup without downloading:

anonymise_database

Anonymise the database by removing identifying information. Parameters: Returns: Examples: Anonymise and download:
Anonymise without downloading:

migrate

Migrate database to the latest schema version. Parameters: Returns: Examples: Migrate database with backup:
Using the input type:

migrate_hash_naming

Migrate hash naming scheme to the latest version. Returns: Examples: Migrate hash naming:

migrate_scene_screenshots

Migrate scene screenshots to the latest storage format. Parameters: Returns: Examples: Migrate screenshots and delete old files:
Using the input type:

migrate_blobs

Migrate blobs to the latest storage format. Parameters: Returns: Examples: Migrate blobs and keep old files:
Using the input type:

optimise_database

Optimize the database. Returns:

setup

Run initial Stash setup. Parameters: Returns:

download_ffmpeg

Download FFmpeg binary. Returns: