refactor: support search caching

remains to be seen whether this is a good idea or not
This commit is contained in:
2025-09-07 05:30:16 +02:00
parent 37e932956d
commit 2a9826eb03
3 changed files with 53 additions and 24 deletions

View File

@@ -633,7 +633,6 @@ def parseViewsFromViewText(viewcounttext: str) -> int:
def search(data, req):
search_query = req.args.get('q')
print(f"search query: {search_query}")
# ignore paginated requests as we do nothing with the continuation token
page = req.args.get('page')
@@ -641,7 +640,6 @@ def search(data, req):
return send(404, [])
if (data[-2].lower() != "search" or data[-1].lower() != "") and data[-1].lower() != "search":
print(f"'{data[-2]}', '{data[-1]}'")
previous_query = req.args.get('pq')
suggestions = ythdd_extractor.WEBgetSearchSuggestions(search_query, previous_query)
return send(200, suggestions)