The Maintenance API exposes three housekeeping operations for ErsatzTV Legacy. These endpoints can be called manually or integrated into a scheduled task to keep memory usage low, remove deleted media permanently, and clean up orphaned artwork files that accumulate over time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ErsatzTV/legacy/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/maintenance/gc
Triggers the .NET garbage collector to release unused memory. Under normal operation ErsatzTV manages its own memory lifecycle, but this endpoint is useful when you need to reclaim memory immediately — for example, after ingesting a large batch of new media.When
true, issues a more aggressive, compacting garbage collection pass. When false (default), performs a standard generational collection.Responses
| Status | Description |
|---|---|
200 OK | Garbage collection was triggered successfully. |
POST /api/maintenance/empty_trash
Permanently deletes all media items that have been placed in the ErsatzTV trash. Items in the trash are media that ErsatzTV has detected as missing from disk and marked for removal. This operation is irreversible — trashed items are removed from the database permanently. This endpoint accepts no parameters.Responses
| Status | Description |
|---|---|
200 OK | All trashed items were permanently deleted. |
500 Internal Server Error | An error occurred; the response body contains a plain-text error description. |
POST /api/maintenance/clean_artwork
Queues a background job to delete orphaned artwork files from the artwork cache. Artwork becomes orphaned when the media item it was associated with is removed or when its artwork URL changes. Over time this can consume significant disk space.The maximum number of orphaned artwork records to delete in this operation. Reduce this value to rate-limit the cleanup job on systems with limited I/O resources.
Responses
| Status | Description |
|---|---|
200 OK | The artwork cleanup job was successfully queued. |
Like library scans, the artwork cleanup runs asynchronously in the background worker. The
200 OK response confirms the job was queued, not that cleanup is complete.