Skip to content

DRY Searches into STORED_SEARCHES#18

Draft
mekarpeles wants to merge 1 commit intostored_searchesfrom
stored_searches-1
Draft

DRY Searches into STORED_SEARCHES#18
mekarpeles wants to merge 1 commit intostored_searchesfrom
stored_searches-1

Conversation

@mekarpeles
Copy link
Copy Markdown
Member

@mekarpeles mekarpeles commented Nov 24, 2025

This pull request refactors and standardizes how default search queries are defined in the OpenLibraryDataProvider class. The main change is to consistently use the Search object for all stored searches, and to construct search queries using ' '.join([...]) for better readability and maintainability. Additionally, it removes global default search settings and ensures each stored search has explicit sort parameters.

Refactoring and standardization of search definitions:

  • Replaced inline query strings with ' '.join([...]) for all entries in the STORED_SEARCHES dictionary, improving readability and consistency.
  • Converted previously string-only stored searches (like "Thrillers" and "Textbooks") into full Search objects with both query and sort parameters, ensuring uniform handling of searches.
  • Added or clarified the sort parameter for each stored search, making sorting behavior explicit for all searches.

Removal of global defaults:

  • Removed global default settings for DataProvider.Search.sort and DataProvider.Search.limit, relying instead on per-search explicit configuration.

@mekarpeles mekarpeles changed the title Refactor search queries for clarity and consistency DRY Searches into STORED_SEARCHES Nov 24, 2025
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.

1 participant