Skip to content

Warn when an OnDeck file is missing from both cache and array#166

Merged
StudioNirin merged 1 commit into
StudioNirin:mainfrom
Brandon-Haney:pr/cache-missing-file-warning
May 12, 2026
Merged

Warn when an OnDeck file is missing from both cache and array#166
StudioNirin merged 1 commit into
StudioNirin:mainfrom
Brandon-Haney:pr/cache-missing-file-warning

Conversation

@Brandon-Haney

@Brandon-Haney Brandon-Haney commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refs #164.

When Plex reports an OnDeck or Watchlist item that PlexCache can't physically locate at either the cache pool path or /mnt/user0/, _get_move_command previously skipped it silently while the pre-move SUMMARY line still claimed the planned size was being cached. That made the run look successful even when 0 files actually moved.

  • Promotes the silent skip in core/file_operations.py:_get_move_command to a WARNING that names both checked paths and calls out the likely cause (a non-default cache pool that isn't mounted into the container).
  • Defers the cache SUMMARY / cached_bytes computation in core/app.py until after move_media_files() returns, and sources it from the actual queued bytes (last_cache_moves_bytes) so the SUMMARY line can no longer diverge from [RESULTS] Moved to cache.

Test plan

  • Run a cache pass against a Plex library whose underlying disk path is genuinely not visible to the PlexCache process (e.g. cache pool not mounted in the container) and confirm the log now shows a WARNING per missing file, with both checked paths and the cache-pool hint.
  • Run a normal cache pass where all OnDeck files exist and confirm the SUMMARY line's cached-bytes value matches [RESULTS] Moved to cache (no longer over-reports against actual moves).
  • Run a --dry-run and confirm the same warnings surface without any files being touched.

When Plex reports an OnDeck/Watchlist item that is not present at either
the cache pool path or /mnt/user0/, _get_move_command silently skipped
it while the pre-move SUMMARY still claimed the planned size was cached.
Promotes the skip to a WARNING that names both checked paths and the
likely cause (non-default cache pool not mounted in the container).

Defers the cache SUMMARY/cached_bytes computation until after
move_media_files() runs and uses the actual queued bytes
(last_cache_moves_bytes) so the SUMMARY line cannot diverge from
[RESULTS] Moved to cache. Refs upstream issue StudioNirin#164.
@StudioNirin StudioNirin merged commit b29f898 into StudioNirin:main May 12, 2026
2 checks passed
@Brandon-Haney Brandon-Haney deleted the pr/cache-missing-file-warning branch May 13, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants