Commit graph

257 commits

Author SHA1 Message Date
48396d6ab6 Add Album.remove_photos for batch removals. 2018-05-01 18:05:07 -07:00
698981dd29 Move _uncache_sums call out of _add_photo, into callers. 2018-05-01 17:48:56 -07:00
fa97512586 Use batches of 999 for get_things_by_id.
SQLite has a limit on how many variables you can use per query.
2018-05-01 17:48:02 -07:00
97e1f881d0 Move video thumbnailing code to helpers. 2018-04-28 20:36:33 -07:00
5bc2bbdacb Move image thumbnailing code to helpers. 2018-04-28 20:33:05 -07:00
41823394eb Use PDB.get_albums_by_id for Photo.get_albums. 2018-04-28 19:17:11 -07:00
62496d183e Use PDB.get_tags_by_id for Photo.get_tags. 2018-04-28 19:14:58 -07:00
b19682d1a5 Replace Photo.sorted_tags with jinja filter. 2018-04-28 19:05:51 -07:00
df7fbeae0a Minor clarity improvements to required_feature logic. 2018-04-27 20:04:18 -07:00
e2cf9344c1 Copy the inputted new_photo_kwargs so as not to damage it.
Also I learned that pop takes a fallback.
2018-04-20 15:31:41 -07:00
fec5eaf21e Add Tag.normalize_name to be called by PDB.normalize_tagname. 2018-04-20 15:28:27 -07:00
4434517c54 Rename config user.min_length -> min_username_length. 2018-04-15 14:36:07 -07:00
21bd211889 Give Users a display_name. 2018-04-15 14:23:24 -07:00
8562b355ce Fix typo in debug commit message. 2018-04-15 13:49:10 -07:00
31b808bd64 Fix get_things_by_id not putting the results in cache. 2018-04-15 02:53:14 -07:00
7d8b8daeba Rewrite Album.sum_bytes to use SQL sum in a single query. 2018-04-15 02:52:41 -07:00
f77ab51b14 Add Album.has_any_photo and has_any_subalbum_photo. 2018-04-15 02:41:24 -07:00
0ee07023a1 Fix ids_needed being modified while iterating. 2018-04-15 02:35:46 -07:00
518a45ccd8 Add method get_things_by_id for mass lookups. 2018-04-15 02:14:06 -07:00
68d6e4faf4 Add explicit method get_album_by_id. 2018-04-15 02:10:42 -07:00
0094e7c006 Fix bug where add_tag supersedence caused early commit. 2018-04-15 01:14:20 -07:00
bfc4f313a9 Switch some formats to f-strings. 2018-04-15 01:13:02 -07:00
028a8cb2ef All of the INTERSECTs can just be WHERE clauses. 2018-04-04 22:08:08 -07:00
c0df14db62 Fix typo binding -> bindings. 2018-04-04 21:40:39 -07:00
abe82dde9e Let get_tag_by_name use cache after finding the ID. 2018-03-31 14:01:03 -07:00
d9f5765bcc Use more self.sql_ instead of own cursors. 2018-03-29 19:24:48 -07:00
144e97d365 Use self.photodb.sql_ methods instead of running own cursors.
All in the name of centralization.
Also improved SQLness of Tag.convert_to_synonym.
2018-03-29 19:24:48 -07:00
2edb9a1d57 Centralize cursors to PDB.sql_execute.
This gives me a nice common place to do logging if I want.
2018-03-29 19:24:39 -07:00
cca8837863 Move helpers.select_generator to PDB.sql_select. 2018-03-25 16:32:17 -07:00
da47b5bb3c Fix several small, embarassing typos. 2018-03-23 01:18:43 -07:00
77dfeb4299 Add more _assert methods to hide clutter. 2018-03-23 00:35:56 -07:00
229530580f Add Tag.normalize_description. 2018-03-23 00:35:56 -07:00
b4d3de3651 Add Bookmark.normalize_title and _url. 2018-03-23 00:35:56 -07:00
6ee86431e5 Add Album.normalize_title and _description. 2018-03-23 00:35:55 -07:00
dddd8a3aa1 Add ObjectBase.normalize_author_id. 2018-03-23 00:35:47 -07:00
1f7749b80a PDB.new_album call album.add_photos instead of add_photo. 2018-03-22 23:11:25 -07:00
0e3ae11610 Improve normalizers, use less None; Add author search box.
It was getting difficult to remember which of the normalizers
use None and which don't. So let's try to be a little more consistent
and just use empty sets, etc, so the caller can rely on receiving a
set instead of having to check for None.

Also renamed search parameter authors->author to be more in line
with the singular form of extension.
2018-03-22 21:09:21 -07:00
088a79ffff Add method PDB.get_users. 2018-03-22 21:06:05 -07:00
5c89e13129 Update DatabaseOutOfDate message to use new upgrader path. 2018-03-22 17:34:43 -07:00
5be174d1b3 Completely rewrite search to use more SQL and less application.
In order to achieve tag_musts, we break each of the musts down
into separate EXISTS queries for each of the matchable children.
Then we INTERSECT those, and finally do other filtering and
ordering as usual.
2018-03-21 19:20:43 -07:00
1e42f1ea4e DB V12: Add (photoid, tagid) index to photo_tag_rel. 2018-03-21 19:00:13 -07:00
acc9b67a20 Add parameter minimal to jsonify.tag. 2018-03-21 18:48:38 -07:00
6c77ddd1c3 searchhelpers.normalize_author use un only, not IDs.
I don't like the idea of a user setting their username to be
someone else's ID.
2018-03-21 13:21:25 -07:00
afc5f38a8d Combine normalize_limit, _offset to normalize_positive_integer. 2018-03-21 11:25:21 -07:00
1d76b4511b Let PDB.get_tag convert normalization errors to NoSuch.
Instead of having to account for them on the other end,
since they don't care about that stuff anyway.
2018-03-21 11:03:58 -07:00
9a1caee412 Add helper function hash_file. 2018-03-18 20:56:29 -07:00
2d73e59abf Let helpers.read_filebytes operate on pathclass Paths. 2018-03-18 20:56:08 -07:00
e186653e36 Use shutil.which to discover ffmpeg.
How did I miss such an easy solution for so long??
So glad I did not go the env var route.
2018-03-18 17:03:11 -07:00
84e0266f30 Add author to object jsonifiers. 2018-03-18 15:59:36 -07:00
60049c777f Add method get_author to all objects. 2018-03-18 15:58:51 -07:00