Commit Graph

1056 Commits (454693f1dcc4ac58630e47329c91759a7f535b99)

Author SHA1 Message Date
voussoir e94e35c98c Add option to natural_sort filenames before digesting. 2020-04-02 21:57:54 -07:00
voussoir 374763f990 Reduce log level of savepoints to 5.
So far I am satisfied with how they are working, and they clutter
the output so much I can't read anything else.
For reference, logging.DEBUG is 10.
2020-04-02 21:56:41 -07:00
voussoir 32a161baa8 Fix prev_page_url offset when on page 2 going back to page 1. 2020-04-02 21:37:50 -07:00
voussoir 89c308c4a4 When submitting search, check for values left in the tag boxes.
I found pretty commonly that it was easy to leave some text in the
box and forget to press enter, so that tag never got added to the
actual search.
2020-04-02 17:11:29 -07:00
voussoir 7fc4604025 Simplify this already_have now that the other code is gone. 2020-04-02 17:09:09 -07:00
voussoir 84833832e4 Improve this comment and some whitespace. 2020-04-02 17:06:50 -07:00
voussoir f8bd34eb7a Let add_searchtag and remove_searchtag take the ul instead of box.
With a name like add_searchtag you'd think it'd be past the point
of reading box input, and deeper into the abstraction zone. But nope,
it wasn't. I'll try to take this a few steps further from here too.
2020-04-02 17:04:23 -07:00
voussoir 3cb8f0adcf Remove code intended for tag trumping but currently useless.
I think at one point I was using full qualnames on the tag objects
in the mmf uls. But now they just show their base name, so this
code is useless. And I don't think I'll reinstate it because tags
have multiple parents now and I don't want to implement all the
lineage checking in the client js. We'll just let the server handle
the slightly less efficient query.
2020-04-02 16:56:44 -07:00
voussoir 00ad82e07c Dedent this code by doing an early return instead of if. 2020-04-02 16:25:19 -07:00
voussoir 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
voussoir 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
voussoir 0fdf08adf5 Fix bug where searching musts=[A, A.B] ignored B.
The problem was that during the expansion of A, B would get added to
the `total` set. And then because B was already in total, it would
bail early instead of expanding, but that meant it got left out of
the final query. But this only happened sometimes since random set
ordering would sometimes expand B before A and everything was ok.
I think the best solution is to do this first pass that eliminates
ancestors. Furthermore, I realized that the entirety of expand_nested
hinged on this flawed logic and was otherwise completely redundant
for a simple list comprehension.
2020-03-19 19:04:09 -07:00
voussoir 13c3a1c0e9 Update docstrings for walk_children, walk_parents. 2020-03-19 19:03:47 -07:00
voussoir 0a8a754cbc Replace set([]) with {}. 2020-03-19 17:40:52 -07:00
voussoir a30649b0a8 Replace looping set.add with set.update. 2020-03-19 17:38:51 -07:00
voussoir e35efb5c61 Make this string an r-string so it gets better syntax highlighting. 2020-03-11 18:11:54 -07:00
voussoir 6529aedde6 Add docstring to PDB.__init__. 2020-03-06 09:43:16 -08:00
voussoir 9ac91d3850 Add tag delete button to specific tag page.
On the main tag listing, for child tags, you only get an unlink
button on hover. So if you want to delete a child tag you'd have to
unlink, then refresh, then delete. Now you can just go to its page
and delete it there.
2020-02-27 14:57:27 -08:00
voussoir 3f2cde02e1 Use send2trash to support recycle_instead_of_delete. 2020-02-27 14:18:46 -08:00
voussoir 961ece0081 digest_directory excludes extend defaults instead of overriding them.
With this change, there is currently no way to specify that I actually
want to include thumbs.db etc, but I think the likelikhood of wanting
to extend the defaults greatly exceeds wanting to overrid them.
2020-02-27 14:17:30 -08:00
voussoir 30a0715980 Add photo delete buttons to hovering toolbox.
I tried putting them in the #left but it was looking seriously ugly.
Actually #left is always ugly because the variety of info and buttons
and text alignments. Hover toolbox is not ideal and I don't want it
to become a dumping ground, but deleting should be a rare action and I
don't want it right next to stuff like the basic metadata.
2020-02-27 14:15:13 -08:00
voussoir 45cb96cc5c Add endpoint /photo/photo_id/delete. 2020-02-26 18:57:29 -08:00
voussoir a88fcc2092 Move the clipboard checkbox into metadata list too. 2020-02-26 18:41:17 -08:00
voussoir 66f73a6aab Move the photo filename out of list to top of left. 2020-02-26 18:40:03 -08:00
voussoir 596eb86f6e Move the refresh metadata button into metadata bullet list. 2020-02-26 18:39:19 -08:00
voussoir 02db1f3971 Make response_type required, explicit in all calls. 2020-02-26 17:50:36 -08:00
voussoir 9d620b4b97 Remove unused imports & other small things. 2020-02-20 22:44:56 -08:00
voussoir b846be75b0 Stop pretending that there are tests. 2020-02-20 21:51:06 -08:00
voussoir ca8c642add Add "Are you sure you want to quit" to erepl. 2020-02-20 18:57:08 -08:00
voussoir 4a193d228c Add commit=True to frontend where necessary. 2020-02-20 00:34:28 -08:00
voussoir 854fa4db51 Rename PDB.register_user -> new_user.
I was treating User a little bit special here, but I prefer to
have the more consistent terminology.
2020-02-20 00:18:40 -08:00
voussoir 1fc2ed09f5 Remove commit argument from ALL methods. @transaction does it. 2020-02-19 23:56:09 -08:00
voussoir 0a984117c5 Add rollback queue, like commit queue. 2020-02-19 23:46:30 -08:00
voussoir 8c854f3b6a Improve this comment about Photo rename logic. 2020-02-19 23:22:08 -08:00
voussoir f99d3d03d9 Photo.rename new_path.assert_not_exists. 2020-02-19 23:12:29 -08:00
voussoir 00a443eec3 Always use the commit queue, don't bypass with commit=True. 2020-02-19 23:12:11 -08:00
voussoir 7f3602d673 Remove @transaction from mixin methods, apply it to object methods. 2020-02-19 23:10:49 -08:00
voussoir 953a85c998 Delete method Tag.leave_group, leftover from 1-parent days. 2020-02-19 23:05:55 -08:00
voussoir 8c797024e0 Remove calls to pdb.commit(). Let @transaction do it. 2020-02-19 22:58:21 -08:00
voussoir 203fb9e00f @transaction intercept commit argument; commit / release here. 2020-02-19 22:36:00 -08:00
voussoir 04f3f6f297 Remove commit=False from all method calls, it's default now. 2020-02-19 22:20:21 -08:00
voussoir 3a9d7fc2dc Set default commit=False for ALL methods.
I'm working on tightening up some of the transaction code. In the
past it was default commit=True because I would launch the repl, do
something, and quit, so it was nice to have auto commit. But really
it makes more sense to have it default False and be explicit when
to commit.
2020-02-19 20:08:24 -08:00
voussoir 108ba8bd95 Add PDB.release_savepoint. 2020-02-19 17:00:08 -08:00
voussoir bcd13b9ae4 Make the commit queue task popping a little more clear. 2020-02-19 16:26:23 -08:00
voussoir e7c90faf79 PhotoDB.rollback without savepoint should roll all, like real sql.
In sqlite3, rollback without a savepoint undoes the entire pending
transaction stack, whereas I was just popping the last save.
This change makes it match real sqlite. Also the only current call
for rollback is in the @transaction decorator which is already
explicit.
2020-02-19 16:26:02 -08:00
voussoir 9e0051ca9c Photo.move_file assert new path doesn't exist yet. 2020-02-19 16:23:31 -08:00
voussoir 1375d9fb26 Fix new_photo, data[extension] to use new pathclass.Extension. 2020-02-19 15:11:52 -08:00
voussoir 5da8d793d6 Return this None instead of assigning then returning. 2020-02-19 14:06:53 -08:00
voussoir e25c6e8697 Use code.interact instead of py -i. 2020-02-19 13:15:03 -08:00
voussoir 31517a41d2 Add missing period on exception message. 2020-02-19 13:11:57 -08:00