Previous called get_data which is dangerous for large but
indeterminate response sizes, and the bail chain was more
difficult to reason about than a simple should_gzip true/false.
Previous version had a bug when the URL contained percent-encoded
spaces because url.replace() was looking for spaces and not replacing
the %20. Constructing the url from parts is more reliable.
With the recent addition of search_embed iframes on other pages, we
had photo cards appearing but the photo_clipboard module was not
imported thus the checkboxes did nothing. I don't want to import
photo_clipboard onto every single page, I'd rather they click through
to the full search UI. Otherwise every single page will have the tray
and often not a good enough reason for it.
So, since the functionality of the checkbox is completely reliant on
the photo_clipboard.js module anyway, there's no reason not to have it
generated by that module.
I was adding messages as strings because that's how they get shown on
the web interface. But it's better to return the real exception objects
and have the interface deal with it.
For a while I've wanted to be able to sort search results by the file's
basename. This is especially important for the cli. SQLite doesn't have
an easy way to split the filepath column by the slash, so the only
choice is to store basename as a separate column. I put it off for a
while but I think it's the right move. However we must not forget to
update it every time we update filepath, which is a bummer.
Move save_clipboard into a 0-timeout. Check checkboxes immediately
instead of relying on apply_check_all / update_pagestate to make a
redundant loop through everything.