Operations for querying system status and statistics.
Bases: StashClientProtocol
Mixin for system query methods.
Functions
get_system_status
Get the current Stash system status.
Returns:
Examples:
Check system status:
check_system_ready
Check if the Stash system is ready for processing.
This method queries the system status and raises an exception if the system is not in OK status. It should be called before starting any processing operations.
Raises:
Examples:
Validate system before processing:
stats
Get system statistics.
Returns:
Examples:
Get system statistics:
logs
Get system logs.
Returns:
Examples:
Get recent logs:
Filter by level:
dlna_status
Get DLNA server status.
Returns:
directory
Browse filesystem directory.
Parameters:
Returns:
Examples:
List root directories:
Browse specific path:
Use specific locale for sorting:
sql_query
Execute a SQL query that returns rows.
This is a DANGEROUS operation that executes arbitrary SQL against the Stash database. Use with extreme caution. Incorrect queries can corrupt your database or expose sensitive information.
Parameters:
Returns:
Raises:
Examples:
Query database for scenes:
Count performers by gender:
This feature requires Stash version that supports SQL queries. The exact version requirement should be documented in the Stash API.
sql_exec
Execute a SQL statement without returning rows (INSERT, UPDATE, DELETE).
This is a DANGEROUS operation that executes arbitrary SQL against the Stash database. Use with EXTREME caution. Incorrect statements can corrupt or destroy your database. Always backup before using this method.
Parameters:
Returns:
Raises:
Examples:
Update scene ratings:
Delete orphaned tags (BE CAREFUL!):
Insert custom metadata:
This feature requires Stash version that supports SQL execution. The exact version requirement should be documented in the Stash API. ALWAYS test queries in a development environment before production use.