Repository navigation
Conversation
get_favorites_ids computed the favorites page offset as `(50 * page_id) + 50` for `page_id >= 1`, so the second page (`page_id=1`) was requested with `pid=100` instead of `pid=50`. rule34.xxx shows 50 favorites per page, and the favorites page links its next page as `pid=50`. As a result, iterating over favorites one page at a time skipped a page from page 1 onward, since `pid=100` is the third page, not the second. The offset is simply `50 * page_id`. Add a regression test asserting that `page_id=1` requests `pid=50` (and not `pid=100`). Signed-off-by: wzd8888 <wzd8888@users.noreply.github.com>
Author
|
Closing this one — focusing contributions elsewhere. Thanks. |
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.
Problem
get_favorites_idscomputed the favorites page offset as:so the second page (
page_id=1) was requested withpid=100instead ofpid=50.rule34.xxx shows 50 favorites per page and links its next page as
pid=50(see thepaginator link on the favorites view). Iterating over a user's favorites one page at a
time therefore skipped a page from page 1 onward, because
pid=100is the third page,not the second.
Fix
The offset is simply:
Tests
Adds
test_rule34Py_get_favorites_ids_pagination, which asserts thatpage_id=1requests
pid=50(and notpid=100). The existingpage_id=0behavior is unchanged(
pid=0). Full suite: 36 passed.Fixes #50
Note: this change was prepared by an AI agent under human direction and review.