Add archive support (Unpackerr integration): fix silent no-op on archive-only transfers, opt-in RAR downloading - #41
Open
msmarcal wants to merge 2 commits into
Conversation
…err) Previously, put.io ARCHIVE files (e.g., multi-volume RAR sets) were either skipped or, if processed, led to premature local copy deletion. This was because *arr applications never report a `downloadFolderImported` event for the archive parts themselves, only for the extracted content (like a video file). This change introduces a `download_archives` config option to enable the download and management of these files. ARCHIVE targets now have a specific `MediaType` and use enhanced import detection: either the archive parts disappear from disk (indicating extractor cleanup, e.g., Unpackerr's `delete_orig` option) or the *arr reports an import event from the transfer's *directory* (for the extracted file). This ensures putioarr correctly waits for extraction and import before cleaning up local archive copies.
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.
TL;DR
Transfers containing only archive files (multi-volume RAR releases, common on
many indexers) are currently marked as imported and deleted without a single
byte ever being downloaded. This PR fixes that silent failure and, behind a
new opt-in flag, turns putioarr + Unpackerr
into a fully working extraction pipeline - the same setup people already run
with qBittorrent/SABnzbd, now working with put.io.
The bug (affects everyone, no config change needed to hit it)
put.io classifies
.rar/.rNNparts asARCHIVE. Inrecurse_download_targets(), onlyVIDEOandAUDIOproduce downloadtargets, so an archive-only transfer yields zero File targets. Then in
is_imported():Vacuous truth: with no targets, the transfer is instantly considered
"imported". The observable sequence, taken from real logs, is:
17:45:27Z directory created
17:45:27Z download done
17:45:27Z imported
17:45:27Z deleted
Same second, zero bytes downloaded, transfer gone. From the user's side the
*arr shows a download that "completed" and then nothing ever arrives - one of
those issues that is very hard to diagnose and easy to blame on the *arr or
on put.io itself.
What this PR does
target list.
download_archives(default:false): when enabled,ARCHIVEfiles become regular download targets and are fetched to disk,where an external extractor (Unpackerr) picks them up. With the flag off,
behavior is byte-for-byte identical to today - existing setups are
untouched.
is_imported(). The *arr neverimports the
.rarparts themselves, it imports the video Unpackerrextracts next to them. So archive targets are considered imported when
either:
delete_orig), ordownloadFolderImportedevent whosedroppedPathlives inside the transfer's folder. Matching is done onthe folder name, not the full path, so it works even when putioarr
and the *arr see the download directory under different path mappings
(Docker setups).
a single cached directory check instead of 71 history scans.
RAR support" section.
Tested end-to-end on a real deployment
Validated in production (Radarr + Unpackerr + putioarr in Docker) with a real
71-part, 6.6 GB RAR release:
download done->watching importsdownloadFolderImportedin historywatching seedingAlso verified that with
download_archives = false(default) the behavior isunchanged, and
cargo checkis clean.Why this belongs upstream
Multi-volume RAR releases are unavoidable on several trackers, and right now
putioarr users have to reject them via custom formats (losing otherwise-best
releases) or lose downloads silently. Unpackerr is the de-facto standard
companion for every other download client in the *arr ecosystem; this PR is
the missing piece that makes putioarr a first-class citizen of that stack,
without changing anything for users who do not need it.
Happy to adjust naming, split commits differently, or add docs/README notes
as you prefer.