fix: set status to idle before finalization on "Nothing to do" path#7
Merged
fix: set status to idle before finalization on "Nothing to do" path#7
Conversation
When all files are already processed (total == 0), the scan takes an early return through _finalize_scan() without first updating the UI status to "idle". Because _finalize_scan() can spend minutes resolving Lidarr IDs for existing corrupt files, the UI keeps showing "Scanning" long after logs say "Nothing to do." Mirror the idle update already present on the normal scan completion path (line 773) so the status dot turns green immediately. https://claude.ai/code/session_01TiRDfaCYdz46ofc1SwTg8v
Extracting the "Nothing to do" early-return block into its own helper brings _run_scan_inner back under the max-complexity=25 threshold. https://claude.ai/code/session_01TiRDfaCYdz46ofc1SwTg8v
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
total == 0), the UI status remained stuck on "Scanning" because the early-return path called_finalize_scan()without first setting status to"idle". Since_finalize_scan()resolves Lidarr IDs for existing corrupt files via HTTP requests, this could block for several minutes with the yellow dot still spinning.status="idle"update that already exists on the normal scan completion path (line 773) to the "Nothing to do" early-return path, so the status dot turns green immediately.Test plan
total == 0)https://claude.ai/code/session_01TiRDfaCYdz46ofc1SwTg8v