Skip to content

Feature Request: Defer "Empty Trash" while library scan is active #9

@danielmbrown603

Description

@danielmbrown603

Is your feature request related to a problem? Please describe.
Currently, Dumpsterr has filesystem validation, but it does not appear to account for the internal state of the media server's scanner. If Dumpsterr triggers an "Empty Trash" command while a library scan is actively running, it can lead to metadata loss, "Date Added" resets, or database contention.

Describe the solution you'd like:
I recommend adding a "Scan Status" check to the existing validation logic.

  • Logic: Before executing the "Empty Trash" API call, Dumpsterr should ping the media server (Plex/Emby/Jellyfin) to see if a library scan is currently in progress.
  • Action: If a scan is active, defer the cleanup and retry after a set interval. If no scan is active, proceed.

I reviewed the current "Solution" list in the documentation:

  • Checks directory accessibility
  • Verifies minimum file counts
  • Follows symlinks
  • Confirms file count thresholds are within an acceptable range
  • Only empties trash when all validations pass

While these filesystem checks are great, they don't catch issues where the filesystem is fine but the Plex database is busy re-indexing. I am recommending this addition to fill that gap, similar to how plex-auto-trash handles safety.

Adding this would:

  • Protect Metadata: Ensure the server doesn't purge entries for items currently being moved or re-scanned.
  • Reduce Database Load: Prevent simultaneous heavy I/O operations (Scanning + Purging) which can cause locks.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions