refactor: support search caching
remains to be seen whether this is a good idea or not
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user