Commit graph

59 commits

Author SHA1 Message Date
ce30077013 First attempt at online permissions. 2023-02-04 13:49:42 -08:00
e4f686c86f Move thumbnail blobs into the database.
I've moved the thumbnails around many times over this project
and hopefully it doesn't happen too many more. Once the database has
tens of thousands of items, the thumbnails start to become the biggest
headache on the disk. Backing up, restoring, and sharding files per
directory are slower and more effortful with separate files. In the db
means the db is a larger file, but this is disk space that was already
getting used anyway. Now it's simpler and has atomic transactions.
2023-01-27 17:34:32 -08:00
e3a0b3898f Move /file/ urls to /photo/id/download. 2022-11-11 21:35:29 -08:00
732c13440e Use flasktools.atom_response. 2022-11-11 11:39:04 -08:00
b64901105c Move search to an entire class of its own.
The initial motivation for this was to make the "more_after_limit"
feature, which would help the UI to not show a next page button when
the number of results was exactly equal to the limit.

However, in order to surface this more_after_limit status using only
the old search generator, it would have to be a special yield at the
end. I was getting tired of the special yields like give_back_params
at the beginning and warning_bag at the end, and this would be worse.

There is a lot of sideband information about the search that is now
more easily accessible when the search is its own object.
2022-11-06 22:58:36 -08:00
172a539f24
Default yield_albums to false instead of true.
I'm finding I just don't like the ux of having them on default.
2022-10-29 17:17:37 -07:00
328e84b0c7
Fix search by SHA256, didn't finish implementing. 2022-10-29 17:17:37 -07:00
3767558c66
Add search filter has_albums.
Sometimes it's nice to search just for the free spirits.
2022-09-28 19:49:01 -07:00
57f1b80442
Use SQL generated columns for area, aspectratio, basename, bitrate. 2022-08-13 18:08:45 -07:00
2562084fce
Experimental atom feed for photos, albums, search. 2022-07-20 19:03:27 -07:00
0e00a1e981
Use new worms version. 2022-07-20 19:03:25 -07:00
4261c42512
Add xdg-open for non-windows use. 2022-01-11 01:00:36 -08:00
5efad72425
Use log.warning for traceback instead of print_exc. 2021-12-21 16:55:46 -08:00
017523bdac
Return 404 if we try to reload_metadata on a missing file. 2021-12-21 16:55:03 -08:00
6794caa32b
Call photo._uncache instead of doing it manually. 2021-10-18 14:10:59 -07:00
91cf08efde
Match renamed flasktools.json_response. 2021-10-01 23:05:46 -07:00
0c51201901
Move truthystring to stringtools. 2021-09-05 01:21:04 -07:00
d4025e865b
Move cached_endpoint, required_fields to flasktools. 2021-09-03 12:45:07 -07:00
82a6103d8d
Fix leftover imports. 2021-06-08 16:04:20 -07:00
f003f55fca
Move make_json_response to voussoirkit.flasktools. 2021-06-04 21:49:45 -07:00
56ab6636cc
Add Swipe UI. 2021-06-03 21:28:05 -07:00
e8cb183849
Add cards.js photos.create, render clipboard batches on client. 2021-05-29 08:46:25 -07:00
89205ac24a
Add interface for copying tags from other photos. 2021-04-29 13:12:37 -07:00
400c255aea
Add "Show in folder" button to photos, albums. 2021-02-25 18:57:41 -08:00
e717833d41
Fix batch cards endpoint still referring to photo_card.html. 2021-01-28 17:01:00 -08:00
0c3ee6f2d2 Add search_embed for bringing search iframes to other pages. 2021-01-02 13:49:43 -08:00
8ecf594945 Move jsonify methods into the objects instead of separate file. 2021-01-01 17:02:01 -08:00
d3f6d6b26a Add exceptions to warning_bag instead of strings for some.
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.
2021-01-01 17:02:01 -08:00
469103e0ac Use voussoirkit.stringtools for comma_space_split. 2020-11-15 22:20:36 -08:00
63bc2dfed5 Add yield_photos, count albums in search result limit.
This experiment of bringing Photos and Albums closer to parity in
search is going well so far. I have found some situations where it
is nice to only get albums back from search results.
2020-09-27 23:38:49 -07:00
667c14f072 Add search argument within_directory. 2020-09-27 10:48:01 -07:00
f5d8898e14 Increase search limit to 1,000. 2020-09-24 14:28:38 -07:00
343ce508bf Add search UI for yield_albums. 2020-09-24 14:26:51 -07:00
adb1d0ef39 Replace all double blank lines with single, improve hash headers.
There was always some semblance that two blank lines has some kind of
meaning or structure that's different from single blank lines, but
in reality it was mostly arbitrary and I can't stand to look at it
any more.
2020-09-19 03:13:23 -07:00
c91888a738 Some linting. 2020-09-15 19:47:07 -07:00
42d4b7fafb Add give_token, catch_etiquette_exception to all endpoints at once. 2020-09-12 11:43:25 -07:00
b0dcc6d3c6 Separately count photo results to fix included albums counting.
I'm currently running an experiment where albums are also included in
search results, but they don't cost you any of your limit parameter.
So the len(results) was often bigger than limit and tricking this
paginator into thinking we needed a next page when really we didn't.
This workaround can be undone when I decide how to make the album
results more official.
2020-09-11 23:12:23 -07:00
8d2af3255b Add endpoints set_searchhidden, unset_searchhidden and checkbox. 2020-09-09 20:51:15 -07:00
7762a8ff07 Rename post_photo_searchhidden -> post_batch_photos_searchidden. 2020-09-09 19:27:22 -07:00
199a4af658 Remove unnecessary intermediate variable view. 2020-09-09 13:15:21 -07:00
6d5cd11612 Let search_core return tags as real lists.
This lets search.html deal with real objects instead of playing with
dumed-down strings.
2020-09-09 13:09:48 -07:00
d585fe92a9 Let search_core return author as real list.
This lets search.html deal with real objects instead of playing with
dumed-down strings.
2020-09-09 13:08:41 -07:00
94b811b3b1 Let search_core return extension as real list.
This lets search.html deal with real objects instead of playing with
dumed-down strings.
2020-09-09 13:07:22 -07:00
c0f24732e1 Remove useless intermediate variable search_kwargs. 2020-09-09 12:13:18 -07:00
18c2f0dc78 Rename vars photos -> results since results may contain albums. 2020-04-02 23:27:47 -07:00
dd3d40de53 Experimental: Allow search results to include albums.
I've been thinking about this for a while but couldn't think of
the perfect way to implement it. I still haven't, so instead I'm
just starting with something and we'll see how to improve later.
At any rate, I can update the rest of the system to expect Albums
coming out of search so that if I ever have a better algorithm
everything else will already be ready for it.
For this first experiment, just any photos that are part of an album
will send that album out as a result. It doesn't even respect the
limit parameter, it's really just to see how it feels to use.
2020-04-02 22:36:40 -07:00
5a394c4376 Use len(photos) >= limit instead of ==. 2020-04-02 22:21:54 -07:00
32a161baa8 Fix prev_page_url offset when on page 2 going back to page 1. 2020-04-02 21:37:50 -07:00
faf0c62426 Check if limit is falsey to avoid useless prevnext buttons.
If limit is 0 then you get prev and next links which also have
limit 0 and are pointless to click.
2020-03-28 17:38:10 -07:00
a00fb65758 Don't leave falsey values out of dict_to_params, let caller do it.
Explicit is better than implicit and all that.
2020-03-28 17:37:28 -07:00