Skip to content

fix: pull unmanaged active transfers from watch folders - #36

Open
bugrax wants to merge 1 commit into
wouterdebie:mainfrom
bugrax:fix-unmanaged-active-transfers
Open

fix: pull unmanaged active transfers from watch folders#36
bugrax wants to merge 1 commit into
wouterdebie:mainfrom
bugrax:fix-unmanaged-active-transfers

Conversation

@bugrax

@bugrax bugrax commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #35 (orphan watch-folder scan). Manually added put.io transfers
(a Watch List entry, or any transfer whose local state was lost) still never
reach the local downloader — they fall through both code paths:

So an unmanaged transfer that is still active on put.io is ignored by the loop
and excluded from the orphan scan: its completed files are never downloaded
or imported.

Fix

scan_watch_folders now excludes only files backed by a managed active
transfer. Files from unmanaged active transfers are treated as orphans and
routed to the correct category (radarr/sonarr), like any other orphaned
watch-folder file.

Testing

Built and deployed to a live instance (640 transfers). Previously-stuck
unmanaged transfers are now picked up by the orphan scan and routed correctly
— e.g. museum...s01e09/downloads/tv (imported by sonarr), and a
manually added movie began downloading instead of being skipped indefinitely.

Manually added put.io transfers (e.g. a Watch List entry, or any
transfer whose local state was lost) never reached the local
downloader. They fell through both code paths:

  - the main transfer loop skips unmanaged transfers, and
  - scan_watch_folders skipped every file whose id belonged to an
    *active* transfer, regardless of whether that transfer was
    managed.

As a result an unmanaged transfer that was still active on put.io was
ignored by the loop and excluded from the orphan scan, so its
completed files were never downloaded or imported.

scan_watch_folders now only excludes files backed by a *managed*
active transfer. Files from unmanaged active transfers are treated as
orphans and routed to the correct category (radarr/sonarr) like any
other orphaned watch-folder file.
Copilot AI review requested due to automatic review settings July 18, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an edge case in the watch-folder orphan scan so that completed files from unmanaged but still-active put.io transfers don’t get skipped indefinitely. It aligns scan_watch_folders behavior with the main transfer loop’s “managed vs unmanaged” policy so unmanaged active transfers can still be recovered via the orphan path.

Changes:

  • Change scan_watch_folders to exclude only files backed by managed active transfers, instead of excluding all active-transfer file IDs.
  • Add clarifying comments describing why unmanaged active transfers must be treated as orphans for watch-folder recovery.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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