Skip to content

Conversation

@reclacc
Copy link
Contributor

@reclacc reclacc commented Jul 3, 2025

Add new autocomplete() method to rule34Py class that provides tag suggestions
based on partial input. Includes new AutocompleteTag class to represent
suggestion results and required API URL configuration.

Changes include:

  • New autocomplete() method in rule34.py with full type hints and docs
  • AutocompleteTag class in autocomplete_tag.py with property accessors
  • Added AUTOCOMPLETE URL constant in vars.py
  • Updated API_URLS with new URL for autocomplete

Method returns suggestions ordered by popularity. Includes referer/origin
headers for compatibility.

@b3yc0d3 b3yc0d3 added the enhancement New feature or request label Jul 3, 2025
Copy link
Contributor

@ripariancommit ripariancommit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall endorsement from me! I was wondering if it was possible to use the tag autocomplete endpoint, and its cool to see that it is.

Replaces the initial implementation of the autocomplete feature with a
reworked version based on reviewer feedback and upstream changes.

Changes include:
- Added autocomplete() method to the rule34Py class for tag suggestions based on partial input
- Results are ordered by popularity and include Referer/Origin headers for compatibility
- Refactored AutocompleteTag into a @DataClass for cleaner structure and type safety
- Moved __autocomplete_url__ to api_urls.py
- Reordered methods in rule34Py class alphabetically for consistency

Also includes:
- Comprehensive unit tests with recorded responses (R34_RECORD_RESPONSES=True)
- Tests validate response types, attributes, and ordering of results

This commit replaces the previous incomplete implementation and aligns with current codebase structure and standards.
@reclacc reclacc force-pushed the feature/autocomplete branch from e5b6c32 to 18b1856 Compare July 24, 2025 11:40
@reclacc reclacc requested a review from ripariancommit July 24, 2025 11:45
Copy link
Contributor

@ripariancommit ripariancommit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for adding a test.

@reclacc reclacc force-pushed the feature/autocomplete branch from 8bb271d to ed3b353 Compare July 31, 2025 13:36
@b3yc0d3 b3yc0d3 merged commit 10696b7 into b3yc0d3:develop Aug 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants