Commit graph

53 commits

Author SHA1 Message Date
da5c1ee008 Let PhotoTags have timestamps; use more js cards.
Tags on photos can now have timestamps, so that if you are tagging
a video or audio you can reference a specific moment with your tag.
In the interface, this means the tag is clickable and seeks to that
point in the media.

For the user interface, I am finding I need to move away from jinja
for the object cards because it is too much hassle to keep the code
for jinja-based cards for static rendering and the js-based cards
for dynamic rendering in sync. Rather than write the same cards in
two languages I can dump the JSON into the script and render the cards
on load. Which makes the static HTML worse but that's what the JSON
API is for anyway.
2023-09-17 14:07:22 -07: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
87e53f85b8 Use select_column. 2022-11-07 18:44:21 -08:00
35dbdd27cf
Add created timestamp column to the rel tables.
Could open new possibilities for tracking, ranking, or just
curiosity.
2022-10-29 17:17:37 -07:00
1fa152f475
Don't rebuild tables that weren't authored by user.
Since generated columsn appear in the output but not the input,
it was crashing. The author of the migrate will know what to do.
2022-10-29 17:17:36 -07:00
cd8aad63b9
Fix 21_to_22 with if exists. 2022-10-29 17:17:36 -07:00
b8e64056fb
Fix 20_to_21 to not rely on current library code. Copy algorithm. 2022-10-29 17:17:36 -07:00
fedd8e00a7
Add tag_exif_camera_lens.py utility. 2022-08-13 18:16:57 -07:00
57f1b80442
Use SQL generated columns for area, aspectratio, basename, bitrate. 2022-08-13 18:08:45 -07:00
d819b23263
Fix thumbnail migrator use of pathclass. 2022-08-13 17:48:26 -07:00
cb43b5d9e0
Migrate all IDs from strings to ints. Random 32 bit IDs in future. 2022-07-20 19:03:26 -07:00
0e00a1e981
Use new worms version. 2022-07-20 19:03:25 -07:00
a436dafa9c
Use worms select_one_value. 2022-06-03 19:47:27 -07:00
d8cc841f5c
Remove unnecessary .absolute_path thanks to fspath. 2021-12-07 12:45:08 -08:00
c5b3c65ea1
Fix hasty and irresponsible leftover site_thumbnails in db.
There was a brief period where the thumbnail filepaths were stored
in full, now they are stored relative to the thumb directory.
But those leftover full paths need to be altered.
2021-10-04 17:23:58 -07:00
f510bb88c0
Use voussoirkit/worms. 2021-10-01 22:42:45 -07:00
1dfbdfa70c
Rename thumbnail directory to just "thumbnails". 2021-09-30 22:03:16 -07:00
e9d5711f29
Some linting. 2021-08-20 22:54:12 -07:00
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
95b95bc7be
Add thumbnail_photo to Album. 2021-01-20 18:26:36 -08:00
49f3f7a208 Add created column to albums, bookmarks, tags. 2021-01-07 23:05:43 -08:00
d1148d85db A few linting fixes. 2021-01-05 17:35:10 -08:00
750bb51868 Fix Migrator behavior... again!
I got pretty close last time, but the one table that I rebuilt manually
inside the with block was, of course, still hanging on to the table_old
when all the others got renamed. Grrr. This new format breaks the whole
thing into separate steps for rename, transfer, drop, all tables
in lockstep.
2021-01-02 13:51:53 -08:00
0cd5427806 database_upgrader no longer needs to be its own directory. 2021-01-01 17:02:03 -08:00
b04f93db19 Delete old_inits, let's always inline from now on.
The Regenerator class should help with the bulk table rebuilding
that the old inits was added for.
2021-01-01 17:02:03 -08:00
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
f9dc720ff8 Add Regenerator to rebuild tables after breaking changes.
See code comments. The problem is that since I always write the
newest upgrader and use it immediately, I've never actually taken
a very old database and run it through the whole series of
upgraders. So that will be necessary to have more confidence in this
system.
2021-01-01 17:01:59 -08: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
9578dc4d67 Add column for photo's st_dev, st_ino to facilitate lost&found. 2020-09-15 14:56:45 -07:00
5f9627da61 Remove all cur, just use photodb.sql_execute. 2020-09-15 14:54:44 -07:00
2d5fb19ce7 Remove automatic BEGIN because it breaks pragma foreign_keys.
It turns out you can't adjust foreign_keys while a transaction is active,
so the upgraders that need to disable and re-enable them were not
working right and encountering foreign key violations.
2020-09-15 14:54:21 -07:00
0a608bcb69 In database_upgrader, use DROP INDEX IF EXISTS. 2020-09-11 16:15:42 -07:00
03ae8325c9 Use same transactional try-except-else as YCDL. 2020-08-10 18:50:54 -07:00
9d620b4b97 Remove unused imports & other small things. 2020-02-20 22:44:56 -08:00
851ab2d4cc main should return the args.func(args) value. 2020-02-08 17:24:57 -08: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
1e42f1ea4e DB V12: Add (photoid, tagid) index to photo_tag_rel. 2018-03-21 19:00:13 -07:00
dffde094e8 Give Albums and Tags an author_id column.
Keeping V11 because I hadn't published previous commits yet.
2018-03-18 15:28:26 -07:00
cc98cf5407 Create subdirs for utilities. 2018-03-18 00:26:57 -07:00
d383000441 Add Foreign Keys, Primary Keys, and NOT NULL constraints. 2018-03-18 00:09:08 -07:00
ffe0be21f5 Fix Photo thumbnail paths to be relative to the PDB's thumb dir.
Previously they were relative to the directory from which the client
was launched, meaning it usually started with ./_etiquette.
Now it should be more portable and less tight.
2018-03-13 02:50:54 -07:00
f3eb6345f7 Let database_upgrader use the photodb instead of raw sql con. 2018-03-13 02:28:09 -07:00
5f6d21fdee Give Photos a searchhidden property.
By default, photos with searchhidden do not appear in the search
results. This allows a small number of representative images from
a large album to appear in the results, while the rest can be
found on the album's page.

The same effect could be achieved with a tag and forbid search,
but tag searching has much higher cost and it would be more difficult
to implement as a default behavior without requiring lots of special
checks whenever listing tags etc.
2018-03-09 17:10:27 -08:00
a4a278c173 Give Tags a description field. 2017-05-12 17:31:17 -07:00
d52143e283 Add nullcheck to associated directory upgrader 2017-03-22 23:56:58 -07:00
efa930f4a8 Make associated_directory its own table so albums can have multiple
Also renamed a bunch of indices
2017-03-16 23:57:31 -07:00
70f284d413 Fix album_group indices being added to the wrong table. 2017-03-10 05:49:18 -08:00
83408aca4a Give Albums their own ID counter, own group rel table 2017-03-04 01:13:22 -08:00