Commit graph

654 commits

Author SHA1 Message Date
c319c6fd58 Add argument check_existing so user can choose to allow duplicates. 2025-11-14 00:44:08 -08:00
6401eaeb14 Fix photo id hasher since ids have been ints for a while now. 2025-11-14 00:39:04 -08:00
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
f3c8a8da3d Add flac to common.MIMETYPES. 2023-09-13 19:34:09 -07:00
3c505e1244 Default _init_sql argument create=False. 2023-06-25 00:05:15 -07:00
ec8644dded Improve video thumbnailer by skipping early black frames. 2023-06-25 00:00:51 -07:00
19a0322901 Convert all thumbnails to srgb. 2023-06-24 23:59:26 -07:00
22702342bc Fix trailing comma in constants.DB_INIT. 2023-02-25 14:16:05 -08:00
d16fcd7c48 Remove specificity preference, let tags of the same branch coexist. 2023-01-27 20:45:58 -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
d5ac0b1717 Minor linting. 2022-11-19 22:43:44 -08:00
e9c5203f11 Fix use of mebibyte. 2022-11-19 22:43:01 -08:00
cfffed81b4 Fix use of timetools. 2022-11-19 22:42:50 -08:00
c9d2806a4f Remove outdated user_id_characters. 2022-11-18 22:01:13 -08:00
52c7df1061 Remove unnecessary fstring. 2022-11-18 22:01:01 -08:00
e3ab2e52e9 Preserve search query, bindings, and explain. 2022-11-13 19:01:41 -08:00
ca2a4ec365 Use boolean in sql declaration, which is an alias for int anyway. 2022-11-11 19:17:43 -08:00
4bde199dbc Use progressbar for hashing of large files. 2022-11-11 15:29:45 -08:00
b99c594931 Add exceptions.GenerateIDFailed. 2022-11-11 15:29:22 -08:00
d1b0fb6aec Add Bookmark.atomify and /bookmarks.atom. 2022-11-11 11:41:24 -08:00
ad84cb28f2 Fix thumbnail_photo return None when photo no longer exists. 2022-11-10 19:39:38 -08:00
1867d30d88 Add log.loud for search query explain. 2022-11-09 19:42:30 -08:00
638dd67cef Let atomify take argument web_root. 2022-11-09 19:42:17 -08:00
fb2a5e9d56 Use user ids for author search instead of usernames. 2022-11-09 19:41:16 -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
de2bf6a81a
Move login code over to User object. 2022-11-06 22:59:12 -08:00
e8e4a3dbc0
Log when closing DB. 2022-11-06 22:59:12 -08:00
a514ed5ff3
Use voussoirkit timetools. 2022-11-06 22:59:11 -08:00
ca3766ea1b
Use count(*) instead of column name. 2022-11-06 22:47:23 -08:00
01697d6667
Add wma, wmv mimetypes. 2022-11-05 23:24:03 -07:00
bec695aec4
Use explicit keyword argument tz=datetime.timezone.utc. 2022-10-29 17:17:38 -07:00
92405e0677
Force minutes in photo.duration_string. 2022-10-29 17:17:38 -07: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
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
35c29e6778
Completely hardcode mimetypes, improve mimetype search query. 2022-10-27 20:53:20 -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
19d12c3132
Jsonify child objects will be ids only, not more json.
Because albums and tags have both parents and children, there's quite
a lot of redundant json when rendering each as a dict. I'd rather
improve the bulk searchability of objects by their ids than bloat
every response with redundant renderings of the same child objects.

Also, all include_* parameters are now nested inside the minimal
check so that minimal will take priority.
2022-09-27 17:53:07 -07:00
762f86c397
Improve usage of trusted_file throughout new_photo, metadata. 2022-09-27 17:45:24 -07:00
219b1ca5bb
Raise NoClosestPhotoDB when FileNotFound. 2022-09-07 18:06:50 -07:00
57d311569f
Initialize sql_write before sql_read so file can be created.
The read only handle doesn't want to create the db file
when it does not yet exist.
2022-09-07 18:06:32 -07:00
4f063cd90e
Fix return value of (photo, is_new) for digest. 2022-08-21 14:01:43 -07:00
f420367d55
Let digest_directory distinguish between new and existing photos. 2022-08-13 18:16:04 -07:00
ec1197d7ca
Add trusted_file to disable metadata safeguards like PIL size limit. 2022-08-13 18:12:21 -07:00
0864572930
Alphabetize _reload_audio_metadata. 2022-08-13 18:09:53 -07:00
57f1b80442
Use SQL generated columns for area, aspectratio, basename, bitrate. 2022-08-13 18:08:45 -07:00
cfe724b384
Update worms, insert data renamed to pairs. 2022-08-13 07:27:16 -07:00
802aae644f
Use pil lanczos. 2022-08-06 16:17:53 -07:00
df5870502a
Add syntax for now+seconds, now-seconds when parsing units.
This helps a lot when it comes to querying for atom feeds. You can
request the last X hours of items instead of picking some limit
that you hope is high enough for the highs and wastes data during
the lows.

You want created=now-86400..now for one day.
2022-08-04 06:10:44 -07:00
f8b1cd9178
Rename hyphen_range to dotdot_range a..b so we can have negatives.
Hyphen range doesn't allow negative numbers. The dot-dot syntax
is used by git, ruby, and others so I think it's a good pick.
2022-08-04 06:10:43 -07:00