fix: pull unmanaged active transfers from watch folders - #36
Open
bugrax wants to merge 1 commit into
Open
Conversation
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.
There was a problem hiding this comment.
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_foldersto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
scan_watch_foldersskips every file whose id belongs to an activetransfer, regardless of whether that transfer is managed.
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_foldersnow excludes only files backed by a managed activetransfer. 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 amanually added movie began downloading instead of being skipped indefinitely.