plex_organization
Fix Plex library clutter and slow performance by organizing files, analyzing media, cleaning bundles, and optimizing the database.
Instructions
Comprehensive library organization and maintenance operations for Plex Media Server.
PORTMANTEAU PATTERN RATIONALE: Consolidates 5 library structural maintenance and database optimization tasks into one tool to streamline the archival and cleanup workflows.
Return Format
{"success": bool, "operation": str, "data": dict|list, "library_id": str|None}
Examples
await plex_organization(operation="organize", library_id="1", dry_run=True) await plex_organization(operation="analyze", library_id="1") await plex_organization(operation="clean_bundles", library_id="1", threshold_days=30) await plex_organization(operation="optimize_database", vacuum=True, reindex=True)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vacuum | No | Run VACUUM during database optimization. | |
| analyze | No | Run ANALYZE during database optimization. | |
| dry_run | No | Simulate organization without making changes. | |
| reindex | No | Run REINDEX during database optimization. | |
| patterns | No | Organization patterns for file naming and structure. | |
| operation | Yes | The organization operation to perform. | |
| library_id | No | ID of the target library. | |
| threshold_days | No | Age threshold in days for cleanup operations. |