Skip to main content

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.

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.

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.
force
boolean
default:"false"
When true, issues a more aggressive, compacting garbage collection pass. When false (default), performs a standard generational collection.

Responses

StatusDescription
200 OKGarbage collection was triggered successfully.
curl "http://localhost:8409/api/maintenance/gc"
The forced GC (force=true) invokes a blocking, compacting collection that frees the most memory but also briefly pauses the process. Use it sparingly and prefer the default unless you have a specific reason to compact the heap.

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

StatusDescription
200 OKAll trashed items were permanently deleted.
500 Internal Server ErrorAn error occurred; the response body contains a plain-text error description.
curl -X POST http://localhost:8409/api/maintenance/empty_trash
Emptying the trash is permanent and cannot be undone. If media files later become accessible again (e.g. a drive is remounted), ErsatzTV will re-discover them on the next library scan, but any custom schedule associations with deleted items will be lost.

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.
limit
integer
default:"100000"
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

StatusDescription
200 OKThe artwork cleanup job was successfully queued.
curl -X POST http://localhost:8409/api/maintenance/clean_artwork
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.

Build docs developers (and LLMs) love