Fix Komga import progress, MU author lookup, and poll-failure logic#25
Merged
Conversation
The progress endpoint acquired the same lock the import holds for its full duration, so every poll blocked until the import finished — live progress never updated. Read the progress dict without the lock instead. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
MangaUpdates returns author objects keyed by author_name, not name, so the list comprehension always produced an empty list and authors were never populated from this fallback path. Matches every other MU call site. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
`!=` binds tighter than `&`, so `ratio & (ratio - 1) != 0` evaluated as `ratio & ((ratio - 1) != 0)` rather than the intended power-of-2 test. With small failure thresholds this fired alerts at non-doubling failure counts. Parenthesize the bitwise op. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
On a server-wide auth/connection error the handler marked every series in the batch as failed — including ones already polled successfully earlier in the loop, overwriting their success and inflating backoff counters. Mark only the current series, then break. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ratings snap to 0.5 increments, not integers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Bug-fix pass over the polling engine, Komga import path, and DB docs. Five logical commits, no behavior changes beyond the fixes.
Fixes
/api/komga/import/progressacquired the same lock the import holds for its full duration, so every poll blocked until the import finished. Reader now reads the progress dict lock-free.a.get("name")but MangaUpdates returnsauthor_name, so authors were never populated from this fallback. Now matches every other MU call site.ratio & (ratio - 1) != 0parsed asratio & ((ratio - 1) != 0)(!=binds tighter than&). With small poll-failure thresholds this fired alerts at non-doubling counts. Parenthesized.user_ratingsnaps to 0.5 increments, not integers.Testing
py_compile+ AST parse pass on all changed files./api/komga/import/progresspolling mid-run before merge.🤖 Generated with Claude Code