You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the REST API to find recipes with given keywords, the LIKE term is case sensitive. This leads to unexpected results if the wrong case is used.
Steps to Reproduce
import requests
import os
import json
import requests
import os
from urllib.parse import urljoin
def find_recipes_in_mealie(searchTerm: str) -> str:
base_url = os.getenv("MEALIE_ENDPOINT")
api_key = os.getenv("MEALIE_API_KEY")
headers = {
"accept": "application/json",
"Authorization": "Bearer " + api_key
}
endpoint = urljoin(base_url, '/api/recipes')
params = {
"queryFilter": = f"name LIKE \"%{searchTerm}%\""
}
response = requests.get(endpoint, headers=headers, params=params)
response.raise_for_status()
recipes_json = response.json()
items = recipes_json["items"]
if (len(items) == 0):
return "No recipes found"
return items
def main():
try:
recipes = find_recipes_in_mealie("chili") # no results
recipes = find_recipes_in_mealie("Chili") # found results
except requests.exceptions.HTTPError as e:
print(f"Error: {e.response.status_code} - {e.response.text}")
if __name__ == "__main__":
main()
First Check
What is the issue you are experiencing?
When using the REST API to find recipes with given keywords, the LIKE term is case sensitive. This leads to unexpected results if the wrong case is used.
Steps to Reproduce
Please provide relevant logs
Not applicable
Mealie Version
Build
2d73c703cb8ee192467adb41bbfc1a714a22a819
Deployment
Docker (Linux)
Additional Deployment Details
No response
The text was updated successfully, but these errors were encountered: