Commit Graph

296 Commits (5b6621ea4ef38775add0bb64ffc26e0eea9cd2b4)

Author SHA1 Message Date
voussoir e982858c28
Add a log.debug when connecting to sqlite file. 2021-12-21 16:57:08 -08:00
voussoir 2eaac9e996
Return early from ephemeral so we can dedent this code. 2021-11-14 15:43:50 -08:00
voussoir 775287d8a8
Match worms abstract base class requirements. 2021-10-09 12:12:43 -07:00
voussoir d14d68b2c8
Use named argument data_directory. 2021-10-02 12:46:06 -07:00
voussoir f510bb88c0
Use voussoirkit/worms. 2021-10-01 22:42:45 -07:00
voussoir 1f7e299821
Add logging for loading / saving config file. 2021-10-01 22:42:45 -07:00
voussoir 920a3d6450
Match configlayers update. 2021-10-01 22:42:45 -07:00
voussoir 617ccc2694
Let create default to False. 2021-09-30 22:03:16 -07:00
voussoir a3f7c796c4
Replace self.sql.commit with self.commit. 2021-09-30 22:03:15 -07:00
voussoir 2831eb43d0
Let closest_photodb have default path='.'. 2021-09-30 22:03:14 -07:00
voussoir 23f9a5427f
Make better use of vlogging. 2021-09-08 19:36:29 -07:00
voussoir e883409daf
Add some type annotations, document some exceptions. 2021-08-31 19:25:42 -07:00
voussoir 071b290fe6
Fix yielded pathclass of purge_deleted_associated_directories. 2021-08-25 21:41:53 -07:00
voussoir e9d5711f29
Some linting. 2021-08-20 22:54:12 -07:00
voussoir 5dae9ba178
Use random.choices instead of random.choice in a loop. 2021-08-09 08:46:59 -07:00
voussoir 53127e59ad
Use stringtools.natural_sorter. 2021-06-07 22:49:26 -07:00
voussoir bfea9c097c
Correct docstring that author arg can't be user ids as strings. 2021-05-19 00:04:14 -07:00
voussoir 2d2e80824f
Migrate scripts from spinal.walk_generator to spinal.walk. 2021-05-17 17:01:11 -07:00
voussoir 26d5ff5730
Update closest_photodb to take starting path argument. 2021-05-16 21:08:51 -07:00
voussoir 399d27bb44
Show absolute path instead of pathclass object in NoClosestPhotoDB. 2021-05-16 16:58:53 -07:00
voussoir a7b0ae4898
Correct docstring list -> set. 2021-05-15 18:18:37 -07:00
voussoir bb782d18b9
Add a little defense against mtime == 0. 2021-05-08 18:25:12 -07:00
voussoir 21f7e7ca22
Don't use fstring in log line. 2021-04-02 18:31:52 -07:00
voussoir 4bf5b6d824
Replace dev_ino with mtime, sha256.
This change was prompted by my discovery that under DrivePool, two
files can have the same dev, ino pair. It's understandable but the fact
of the matter is I don't want to rely on inodes any more.
Hashing has the downside of speed, but considering the time investment
of tagging files in the first place I think it should be worthwhile.
2021-02-03 12:12:47 -08:00
voussoir ce8c367901
When searching for renames, check if the old still exists. 2021-01-25 13:44:36 -08:00
voussoir 94c512350c
Fix thumbnail_photo not set in new_album. 2021-01-24 21:39:25 -08:00
voussoir e5be26f8b0 Add PhotoDB.closest_photodb for frontend instantiation. 2021-01-09 15:42:16 -08:00
voussoir fb65138266 get_things_by_sql queries should select *, not just ID.
By passing the ids into get_things_by_id which checks the cache first
before querying the rest, any orderby statements in the query would
effectively become useless.
2021-01-09 11:26:19 -08:00
voussoir 49f3f7a208 Add created column to albums, bookmarks, tags. 2021-01-07 23:05:43 -08:00
voussoir fb126a0540 Log cache misses. 2021-01-07 19:23:34 -08:00
voussoir 75c8dccf1b Add warning when tag search has been nullified by has_tags=False. 2021-01-05 15:54:35 -08:00
voussoir fec280bf99 Rename easybake status new_synonym -> add_synonym. 2021-01-05 14:01:13 -08:00
voussoir 11b846a3e0 Move random_hex function to voussoirkit/passwordy. 2021-01-05 12:38:04 -08:00
voussoir 8944755dc4 Rollback if an on_commit action fails. 2021-01-03 00:19:08 -08:00
voussoir 2c29c196a7 Return friendly and expanded orderby column separately.
Previously, the UI had to un-transform the expanded column back
into the friendly name, which was silly and cumbersome.
2021-01-01 17:02:02 -08:00
voussoir 6522bda09c Add basename in separate column so we can orderby 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.
2021-01-01 17:02:00 -08:00
voussoir 6a98631f2d Add sql_executescript. 2021-01-01 17:01:59 -08:00
voussoir 8e964e2888 Add get_albums_within_directory. 2021-01-01 17:01:52 -08:00
voussoir 4988f6dbdd Fix missing parameters for get_users_by_sql. 2020-11-15 22:20:36 -08:00
voussoir 6fe3cecead Remove old import for logging. 2020-11-15 22:20:36 -08:00
voussoir 7d454a03ac Incorporate __name__ into photodb's logger. 2020-11-15 22:20:36 -08:00
voussoir 8e3bcbc1af Promote some logs from debug to info, and add punctuation. 2020-11-08 21:29:56 -08:00
voussoir d653317907 Let sql_execute log as LOUD. 2020-11-08 20:21:40 -08:00
voussoir de2f1caa42 Don't use log_level from config -- pass it in to constructor.
The problem with the log_level config was twofold. First, there is some
work to be done before the config is be loaded, and so we must hardcode
the log level for that. I was using debug. Secondly, I have realized
that log levels should be pushed as close to the front of the UI code
as possible, not the backend code.
2020-11-08 20:09:16 -08:00
voussoir 40d369e2bb Fix handling of root drive path as within_directory. 2020-10-25 20:18:56 -07:00
voussoir 90e7f6b6e1 Rewrite tag_export.easybake as a generator. 2020-10-17 17:56:21 -07:00
voussoir 735fbf9abd Let the purge methods yield their deleted items. 2020-09-30 13:41:42 -07:00
voussoir 3a8aadf6aa Remove __main__ from photodb.py. 2020-09-28 20:15:28 -07:00
voussoir 6eb4d887ba Replace create_or_get_photos with singular. 2020-09-28 20:14:10 -07:00
voussoir 949e6f68fe Remove support for two Photos with same path.
I have yet to find a practical need for this, and all it does is cause
headaches about the safety of moving / renaming the file.
2020-09-28 14:18:10 -07:00