Skip to content

fix(import): reject a vanished file on manual import execute instead of aborting the batch - #249

Open
jordanfelle wants to merge 1 commit into
Chaptarr:developfrom
jordanfelle:fix-manualimport-execute-vanished-file
Open

jordanfelle wants to merge 1 commit into
Chaptarr:developfrom
jordanfelle:fix-manualimport-execute-vanished-file

Conversation

@jordanfelle

Copy link
Copy Markdown

Fixes #225.

Problem

ManualImportService.Execute reads fileInfo.Length for every selected file with no Exists check 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), FileNotFoundException aborts 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 with FileNotFoundException and passes now (the vanished file is a rejected decision with size 0, the present file is passed to the import step with its size).

…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.
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.

[BUG] Manual import execution aborts the whole batch when one selected file has vanished

1 participant