fix(import): reject a vanished file on manual import execute instead of aborting the batch - #249
Open
jordanfelle wants to merge 1 commit into
Open
jordanfelle wants to merge 1 commit into
jordanfelle wants to merge 1 commit into
Conversation
…le batch ExecuteManualImport read fileInfo.Length for each selected file with no Exists check, so one file that disappeared between the preview and the execute threw FileNotFoundException and none of the other files were imported. Reject just that file with a 'Selected file no longer exists' reason (as the grouped-suggestion path already does) and continue with the rest of the batch.
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 27, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 27, 2026
jordanfelle
added a commit
to jordanfelle/chaptarr
that referenced
this pull request
Sep 27, 2026
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.
Fixes #225.
Problem
ManualImportService.ExecutereadsfileInfo.Lengthfor every selected file with noExistscheck and no per-file try/catch. If one file disappears between the preview and the execute (a torrent moved, a cleanup job, a failed earlier import),FileNotFoundExceptionaborts the whole command and none of the other files are imported. The preview side of the same problem is fixed in #208.Fix
In the execute loop, a file that no longer exists gets a rejected decision ("Selected file no longer exists: ''."), the same wording as the grouped-suggestion path (~line 694), and the loop continues with the remaining files. Files that exist are unaffected.
Verification
New
ManualImportExecuteVanishedFileFixture: executes a batch of one vanished and one present file; it fails on the old code withFileNotFoundExceptionand passes now (the vanished file is a rejected decision with size 0, the present file is passed to the import step with its size).