Commit graph

98 commits

Author SHA1 Message Date
22702342bc Fix trailing comma in constants.DB_INIT. 2023-02-25 14:16:05 -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
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
ca2a4ec365 Use boolean in sql declaration, which is an alias for int anyway. 2022-11-11 19:17:43 -08:00
01697d6667
Add wma, wmv mimetypes. 2022-11-05 23:24:03 -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
35c29e6778
Completely hardcode mimetypes, improve mimetype search query. 2022-10-27 20:53:20 -07:00
57f1b80442
Use SQL generated columns for area, aspectratio, basename, bitrate. 2022-08-13 18:08:45 -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
59eddb9d07
Remove pragma count_changes, which is deprecated. 2022-03-26 13:22:00 -07:00
b3ed94c22b
Replace these warning strings with proper exception classes. 2021-10-18 14:17:20 -07:00
7b7c74b15d
Use a semicolon instead of ampersand for the linux example. 2021-10-18 14:09:31 -07:00
1dfbdfa70c
Rename thumbnail directory to just "thumbnails". 2021-09-30 22:03:16 -07:00
0c51201901
Move truthystring to stringtools. 2021-09-05 01:21:04 -07:00
ddd35b3789
Remove index to defunct dev_ino.
wow!
2021-03-29 22:59:29 -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
25de9be94a
Let truthystring take a fallback. 2021-01-28 17:21:30 -08:00
95b95bc7be
Add thumbnail_photo to Album. 2021-01-20 18:26:36 -08:00
9f9d724a71
Move create table users to alphabetical order.
I thought foreign-keyed tables had to be defined first,
but it turns out that's not the case.
2021-01-19 09:42:51 -08:00
e5be26f8b0 Add PhotoDB.closest_photodb for frontend instantiation. 2021-01-09 15:42:16 -08:00
49f3f7a208 Add created column to albums, bookmarks, tags. 2021-01-07 23:05:43 -08:00
b73fb69612 Add comment about foreign keys. 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
f9e7049424 Change allowed_orderby_columns from list to set; alphabetize. 2020-12-29 16:06:43 -08:00
6fe3cecead Remove old import for logging. 2020-11-15 22:20:36 -08:00
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
b2290d030a Allow orderby bitrate. 2020-10-12 22:28:09 -07:00
2db1f12bfb Add constants.USER_ID_CHARACTERS and show that when raising invalid. 2020-09-19 03:51:55 -07: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
39b7f3cd98 Experiment: Remove character whitelist for tag names.
I have always felt bad about forbidding unicode in tag names,
but I want to make sure I have a grip on sanitization / preventing
abuse before allowing it. I think stripping control characters is
enough and any abuse can be handled manually.
Of course that's all fiction because there are no users except myself.
2020-09-17 18:52:06 -07:00
9578dc4d67 Add column for photo's st_dev, st_ino to facilitate lost&found. 2020-09-15 14:56:45 -07:00
3f2cde02e1 Use send2trash to support recycle_instead_of_delete. 2020-02-27 14:18:46 -08:00
9d620b4b97 Remove unused imports & other small things. 2020-02-20 22:44:56 -08:00
5da8d793d6 Return this None instead of assigning then returning. 2020-02-19 14:06:53 -08:00
92f3569971 Use of extract_table_column_map has moved to sqlhelpers. 2020-02-07 15:15:49 -08:00
25ed427272 Wrap DB_INIT in a transaction. 2020-02-04 18:43:30 -08:00
93eb693bee Separate version_pragma from other pragmas!
This was a dumb bug. Because the version was included in the pragmas
that get set on every load, the database was receiving the new
user_version simply by setting skip_version_check=False and letting
the regular pragmas load, so all future checks passed without
having to run the db upgrader.
2020-01-27 20:46:32 -08:00
222d63857e Replace which with winwhich. 2020-01-21 23:50:11 -08:00
2f33023025 Replace singular guard continue with simple if. 2019-04-01 23:16:25 -07:00
d0208154e4 Add a function to clarify SQL_COLUMNS creation. 2018-11-11 19:08:31 -08:00
dbdd509cd2 Rearrange imports so voussoirkit is right after lib imports.
Added a styleguide.md file to refer back to.
Since voussoirkit is a library it feels better to have it below
the rest of the library and above the local project imports.
2018-11-04 19:27:20 -08:00
4a39873fed Increase default tag cache to 10,000. 2018-07-18 18:27:18 -07:00
c37b54b456 Add dividers and rearrange some of the table column parsing. 2018-07-13 19:22:05 -07:00
0852630cd1 Alphabetize _extract_table_name. 2018-06-30 12:55:30 -07:00
11fda94968 Make the SQL_COLUMNS code a bit easier to read. 2018-05-06 21:09:02 -07:00
96d79f2b25 Oops, let separate loading of pragmas for not-first-time load.
Since DB_INIT was only run during first time setup, all future
loads were not running the pragmas, not even the FK restriction.
2018-05-03 19:02:53 -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