Skip to content

fix: Use exact match for scraping first#892

Merged
TomBursch merged 2 commits intoTomBursch:mainfrom
avogler:exact_item_match
Oct 18, 2025
Merged

fix: Use exact match for scraping first#892
TomBursch merged 2 commits intoTomBursch:mainfrom
avogler:exact_item_match

Conversation

@avogler
Copy link
Copy Markdown
Contributor

@avogler avogler commented Oct 6, 2025

fix: try a exact match of scraped ingredients before using partial string match and order results of partial match to make it predictable

resolves #891

@TomBursch
Copy link
Copy Markdown
Owner

Hi, thanks for tackling this!
Shouldn't the order by name already be enough such that we don't need

item = Item.find_by_name(household.id, name)
        if not item:
            item = Item.find_name_starts_with(household.id, name)

Since with order by the shortest names are listed first, which, if an exact name exists, is always that?

@TomBursch TomBursch added the bug Something isn't working label Oct 18, 2025
avogler and others added 2 commits October 18, 2025 22:21
…ring match and order results of partial match to make it predictable
@TomBursch TomBursch merged commit 17a1338 into TomBursch:main Oct 18, 2025
1 check passed
@TomBursch TomBursch changed the title fix: try a exact match of scraped ingredients before using partial st… fix: Use exact match for scraping first Oct 18, 2025
@avogler
Copy link
Copy Markdown
Contributor Author

avogler commented Oct 18, 2025

Yes, you're right. This was redundant.

@avogler avogler deleted the exact_item_match branch November 21, 2025 08:18
w0s1nsk1 added a commit to w0s1nsk1/kitchenowl that referenced this pull request Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Scraping a recipe matches wrong ingredients if item is ambiguous

2 participants