Content-Length: 254515 | pFad | http://github.com/internetarchive/openlibrary/commit/c1d6788a9a4ca2f6f0a99161ec0d5ffefec665f4

57 Merge pull request #9112 from internetarchive/feat/improve-language-a… · internetarchive/openlibrary@c1d6788 · GitHub
Skip to content

Commit

Permalink
Merge pull request #9112 from internetarchive/feat/improve-language-a…
Browse files Browse the repository at this point in the history
…utocomplete

improve language autocomplete speed
  • Loading branch information
mekarpeles authored Apr 22, 2024
2 parents 65a59ca + 23d7f1b commit c1d6788
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions openlibrary/plugins/openlibrary/js/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ export default function($) {
const term = options.termPreprocessor(q.term);
const params = {
q: term,
limit: options.max,
timestamp: new Date()
limit: options.max
};
if (location.search.indexOf('lang=') !== -1) {
params.lang = new URLSearchParams(location.search).get('lang');
Expand Down
1 change: 1 addition & 0 deletions openlibrary/plugins/worksearch/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class languages_autocomplete(delegate.page):
def GET(self):
i = web.input(q="", limit=5)
i.limit = safeint(i.limit, 5)
web.header("Cache-Control", "max-age=%d" % (24 * 3600))
return to_json(
list(itertools.islice(utils.autocomplete_languages(i.q), i.limit))
)
Expand Down

0 comments on commit c1d6788

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/internetarchive/openlibrary/commit/c1d6788a9a4ca2f6f0a99161ec0d5ffefec665f4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy