3c4f69f647
Specify name= on calls to PDB.get_tag.
...
Sometimes it's easy to forget whether its the name or ID,
and I like the consistency of specifying.
2018-02-16 22:25:56 -08:00
16ac6f8b85
Move UN / PW validation to helper _assert methods.
2018-02-16 22:18:19 -08:00
173c07a0bf
Add some more exception hierarchy. Exists / InvalidUN/PW.
2018-02-16 22:13:54 -08:00
1c1e7f158f
Minor fixes & pylint appeasements.
2018-02-16 21:28:36 -08:00
e5a316ff9c
Remove old SQL_ constants. Use the dicts.
2018-02-16 20:40:58 -08:00
a8ead9c0c9
Replace a lot of manual insert/update with helper.
2018-02-16 20:19:18 -08:00
3e5031a1c5
Add methods sql_insert, sql_update to centralize sqlhelper work.
2018-02-16 18:49:02 -08:00
655d1fa235
Prepare to use dicts SQL_COLUMNS, _INDEX instead of separate.
2018-02-16 18:48:03 -08:00
4e8a67aa54
Avoid sql indexing by instantiating User earlier.
2018-02-16 18:40:57 -08:00
bc4e228a25
Remove a lot of the commented code from earlier search.
2018-02-04 15:11:46 -08:00
f7dcb489c5
Remove unnecessary intification of timestamps.
...
I decided I want to have higher precision especially because
batch inserts were having several photos with the same
created timestamp making orderby >= dumb.
2018-02-03 01:35:32 -08:00
dec28b321a
Rename recursive_dict_update's parameters for clarity.
2018-02-03 01:10:54 -08:00
f266e1c79c
Split PhotoDB's large init into some smaller portions.
2018-02-03 01:10:04 -08:00
f9ee56187c
Rename attr database_file to database_filepath.
...
To make it more consistent with config_filepath and show
that it's a path object.
2018-01-30 19:46:43 -08:00
c62e6cd80b
Fix synonym fetcher using outdated column name.
2018-01-13 20:02:49 -08:00
14750eafc5
Move DB_INIT to constants; auto parse column names.
2018-01-13 16:48:48 -08:00
178a7df0b3
Add some more log debugs.
2018-01-11 19:32:15 -08:00
b5902ba4f1
Integrate voussoirkit sqlhelpers.
...
https://github.com/voussoir/else/tree/master/SQLHelpers
2018-01-09 21:15:50 -08:00
6f371701e4
Fix digest second-scan bug; Break down into smaller functions.
...
There was a bug where moving an album out of its determined parent
caused future digests to fail because I wanted to use the GroupExists
for control flow, but due to the @transaction decorator it was rolling
back the changes.
Moved some of the logical pieces of the function into subfunctions
as a visual and readability aid.
2018-01-09 18:59:15 -08:00
d548e09a96
Add .nfo to the custom mimetypes as text/plain.
2018-01-09 18:46:32 -08:00
b859dbd22a
Add bookmark cache, replace get_bookmark code with call to get_thing.
2017-12-20 20:10:58 -08:00
0b5f736574
Few minor text fixes.
2017-12-16 03:45:07 -08:00
13803dc7f7
Oops, put remove_path_badchars where it belongs alphabetically.
2017-12-07 21:37:55 -08:00
f39717c216
Minor improvements to other helpers and their docstrings.
2017-12-07 21:32:37 -08:00
0d0354f4da
Rename normalize_filepath to remove_path_badchars.
...
Because the function does not do any resolving or converting
to an absolute path, I feel the name 'normalize' is inaccurate
and could be misleading when read. This is more clear.
2017-12-07 21:15:10 -08:00
6cf355d7ce
Rename comma_split to comma_space_split to better describe behavior.
2017-12-07 20:58:06 -08:00
a7b5a7d42a
Multiple small cleanups, docstrings, messages, lint improvements.
2017-11-27 15:56:16 -08:00
e6a50500b9
Fix missing file_read_chunk from default config
2017-11-26 02:37:33 -08:00
f052858d5f
Improve log creation and use custom formatter.
2017-11-26 02:37:11 -08:00
be35f3bb1f
Fix Tag.rename from raising TagExists for old instead of desired new.
2017-11-23 21:58:38 -08:00
64d8410977
No need for self.cur, just cur.
2017-11-16 18:03:51 -08:00
259c9ee1ab
Add PhotoDB init arg ephemeral
. Uses :memory: sql and tempdir.
...
Primarily necessitated by unit testing. Running through the DB_INIT
is quite slow on disk, so this argument causes the sql to be done
on an in-memory database and all the other files are put into a
TemporaryDirectory.
Eventually I would like to have the other files be in-memory too
but that may be overcomplicated and underuseful.
2017-11-16 18:02:05 -08:00
74f4e74bdf
Add a few docstrings and update readme to-do list.
2017-11-16 16:46:39 -08:00
8f000543ea
Add exceptions.DatabaseOutOfDate instead of just using an error string.
...
And don't raise SystemExit. Not sure what I was thinking.
2017-11-16 16:33:40 -08:00
009c0dc678
Allow the data_directory to contain colons (fully qualified paths)
2017-11-16 16:32:05 -08:00
73d2ef5bbf
Change exception __str__ to be the type + message
...
Because the repr is ugly
2017-11-16 16:31:10 -08:00
a510c7b55c
Improve Album bytes caching, start caching photo count.
...
More careful uncaching of the summed bytes, to minimize
recalculation. Fewer cases where the album itself
is removed from the photodb's getter cache.
This also helps the download link on album pages disappear if
the child albums don't actually have any photos.
2017-11-12 15:21:53 -08:00
96856e9361
Cleanup: More minor dusting, commenting, clarity renaming.
2017-11-11 22:49:03 -08:00
bb5fa816d8
Cleanup: Rename GroupableMixin.add to add_child for clarity.
...
Especially since for albums it might sound like you're adding a photo.
2017-11-11 22:41:26 -08:00
3f69a2c240
Cleanup: Replace "objectid" with "object_id" in the Python portions.
2017-11-11 22:38:51 -08:00
a4b875b9ff
Fix config file not being updated when the default updates.
...
The len check was incorrect ever since I started nesting keys.
Now we measure all of the keys recursively.
2017-10-05 18:39:34 -07:00
a0f68fa858
Add .opus to the extended mimetypes.
2017-10-04 16:54:28 -07:00
121f8329fb
improve normalize_authors text
2017-09-29 14:32:35 -07:00
0849796986
Make build_query
params all optional, more kwargy.
2017-09-23 11:22:05 -07:00
855e94ed87
Make wheres
a set instead of list.
2017-09-23 11:20:38 -07:00
163e960bfa
Fix unrecognized orderby not using the warning bag.
2017-09-23 11:08:19 -07:00
557f78eb02
Integrate author search into the query instead of postprocessing.
...
Much faster this way.
2017-09-23 11:04:26 -07:00
38e72c0c3a
Make notnulls
set instead of list.
2017-09-23 11:00:37 -07:00
26a034c9a0
Make Photo.author
a @property; None if no author.
2017-09-23 10:58:04 -07:00
89d9c1d893
Move the new photo creation out of the exception handler.
...
I don't like the "during the handling of the above exception" because
it's misleading as to the source of the problem.
2017-08-01 18:13:54 -07:00
bd847159fa
Organize config by nesting related stuff.
...
I thought about switching to .ini files but that's even less desirable.
2017-07-29 16:23:15 -07:00
4fc203634c
Add new config "enable_login".
2017-07-20 23:25:23 -07:00
1784e584e2
Don't let Bookmark.edit with a blank url.
2017-07-13 22:58:02 -07:00
fcd507e337
Add new_photo_kwargs param to digest_directory.
2017-06-16 02:23:48 -07:00
707a9ab7c2
Fix a few bugs when photo.bytes is None.
2017-06-15 23:08:20 -07:00
6bed300496
Add more feature_required decorators and config.
2017-06-14 23:15:47 -07:00
a7cb922983
Fix missing exceptions import
2017-06-14 22:47:50 -07:00
bc5df9f1c2
Add max_len
parameter to Tag.qualified_name.
2017-06-13 20:11:30 -07:00
8a0bbbcc56
Add /bookmarks/create_bookmark endpoint. No interface yet.
2017-06-12 20:15:02 -07:00
ac2b820a30
Add PDBTagMixin.get_root_tags
2017-06-11 22:57:08 -07:00
d10fe47dc4
Add parentheses to default tag chars.
2017-06-11 22:56:21 -07:00
821a5f3371
Move export functions to their own module.
2017-06-11 22:55:45 -07:00
4f03815a30
Floating point h Ⓜ️ s, and update to-do.
2017-06-11 21:09:17 -07:00
c88654346b
Fix not jsonifying the parent album.
2017-05-13 15:44:03 -07:00
4928095abb
Minor commentary and cleanup
2017-05-13 15:27:08 -07:00
55c14f3844
Don't leave bitrate undefined for non-temporal photos.
2017-05-12 17:50:31 -07:00
a4a278c173
Give Tags a description field.
2017-05-12 17:31:17 -07:00
a485be3c64
Make bitrate a real attribute instead of calculating in jinja
2017-05-11 22:34:19 -07:00
a5924b4642
I don't know how I forgot about dict(zip())
2017-05-11 22:32:55 -07:00
091dc82f1e
Catch expressionmatch.NoTokens for filename search
2017-05-06 18:37:02 -07:00
5b7c05c39d
Improve MMF search speed by pre-filtering photo IDs
...
Not perfected yet but it's an improvement.
Waste less time checking all photos, presearch for matching photos via photo_tag_rel table.
2017-05-01 21:27:54 -07:00
fbf73ac515
Since @transaction rolls back exceptions, don't use exception-based inserts.
2017-05-01 21:26:07 -07:00
a9c7ad6993
Improve separation between front & back with etiquette_flask package
...
Move flask-specific operations out of etiquette's files and into new etiquette_flask. In etiquette_site.py, etiquette calls are fully qualified.
2017-05-01 21:23:16 -07:00
83b9adbd61
Add more uncache points to help with stale data
2017-05-01 21:16:10 -07:00
8080d92f8d
add_associated_directory checks for dupe, so remove old check
2017-05-01 20:50:52 -07:00
06522ee372
Minor cleanup
2017-05-01 20:49:59 -07:00
43bc1e74fc
Add method Album.add_associated_directory
2017-05-01 20:43:45 -07:00
09f209719b
Add decorators.@required_feature to centralize FeatureDisabled exc.
2017-05-01 20:41:56 -07:00
af6785cead
Add decorators.@transaction to rollback sql upon exception
2017-05-01 20:23:58 -07:00
6ea3e67d86
Add method associated_directories.
2017-04-22 21:39:07 -07:00
528302b674
Relax Exists params; Add the .args tuple.
2017-04-22 21:20:03 -07:00
82ca1a08da
Add superinit to the objects.
2017-04-22 21:16:30 -07:00
d95eac4bb6
Minor improvements, update to-do list.
2017-04-20 18:31:48 -07:00
e3610eef2b
Standardize NotExclusive exception usage.
2017-04-20 18:29:30 -07:00
cc0c847eb5
Make sure easybake uses the normalized name in return notes.
2017-04-20 18:28:11 -07:00
24b6970617
Move default DB filename etc. to constants
2017-04-20 18:26:15 -07:00
241d1466eb
Fix tag expression bugs, move work to searchhelpers
...
Fix handling of bad tags, bad syntax, empty expression. Remove unnecessary warning_bag from matcher builder
2017-03-31 21:52:49 -07:00
791172e073
Support extension=* search, to filter extensionless files
2017-03-23 15:49:55 -07:00
5ee6062cad
Use None check instead of general falsey for minmax
2017-03-23 15:17:19 -07:00
b69ef8ea00
Cleanup some pylint
2017-03-23 15:11:28 -07:00
dcb946f3df
Add _uncache to objects
2017-03-23 00:04:44 -07:00
0bfbc789ca
Use more pathclass.Path
2017-03-22 23:35:14 -07:00
d35011c083
Add Photo.relocate for fixing external renames
2017-03-22 23:18:09 -07:00
13040d559b
Cache objects for faster re-access; Cache album.sum_bytes result
2017-03-22 22:54:17 -07:00
55ed6a6d28
Give each PDBMixin an init and a cache. Not used yet
2017-03-22 21:24:53 -07:00
e62aa2f740
Make condition look better
2017-03-22 18:06:02 -07:00
fd1673328f
Add PDBAlbumMixin.get_root_albums to simplify elsewhere
2017-03-19 18:48:41 -07:00
97400a448b
Fix bug which left album dir associations after deleting album
2017-03-19 18:48:12 -07:00
8793d9ff41
Fix docstrings over 80 characters
2017-03-19 17:34:19 -07:00
df32b0c11d
Fix NameError during forbids
2017-03-17 14:02:03 -07:00
80a861deee
Add 'enable_photo_reload_metadata' and '...generate_thumbnail'
2017-03-17 14:01:39 -07:00
019c0d727d
Use metaclass to automate exc error_type; Remove needless inheritance
2017-03-17 02:30:02 -07:00
85d91310bc
When new options are added, save them to user config file
2017-03-17 01:28:29 -07:00
0bac643f2d
Add jsonify.exception
2017-03-17 01:13:42 -07:00
6912a1a56e
Fix login form using old error response
2017-03-17 01:08:51 -07:00
f222ae7182
Add 'enable_photo_add_remove_tag' config
2017-03-17 00:10:33 -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
440941077f
Replace more direct sql commits with PhotoDB commits
2017-03-16 21:44:49 -07:00
8692d826c5
Add 'enable_new_...' config options. Decent until actual permission system
2017-03-16 19:54:12 -07:00
db628d158e
Shorten lines longer than 100 characters
2017-03-14 21:18:42 -07:00
defa23eff3
Add Album.@display_name to remove duplicate logic elsewhere
2017-03-10 17:08:38 -08:00
f797e3fb55
Fix exceptions.RecursiveGrouping not being formatted.
2017-03-10 15:33:45 -08:00
bff5ee9986
Don't raise GroupExists when adding to the same group anyway.
2017-03-10 15:27:40 -08:00
afe7085702
Make photo.duration_string a @property
2017-03-10 15:07:34 -08:00
d7cd1e9748
Add more docstrings; Remove unused code
2017-03-10 15:01:12 -08:00
3be8813a0a
Photo.add_tag returns the added tag; site displays the normalized name instead of user input
2017-03-10 14:04:50 -08:00
70f284d413
Fix album_group indices being added to the wrong table.
2017-03-10 05:49:18 -08:00
1fc098a37f
Fix on_commit_queue action for rename_file; Fix tag sorting
2017-03-10 05:18:49 -08:00
072e9a7430
Fix NoSuchUser being raised with None due to username/id
2017-03-09 23:54:45 -08:00
b3da21bf33
Small cleanups
...
Comment and sql linewrapping; move Add Tag box to top of ul instead of bottom to stay in view better
2017-03-07 20:20:12 -08:00
2deff86e13
Fix broken registration: missing cur and wronge exc
2017-03-05 05:00:57 -08:00
c04b5a6db0
Remove unnecessary warning_bag code from normalize_tagname
2017-03-05 04:54:58 -08:00
e413e996d9
Fix appearance of easybake errors; more exception improvements
...
New class EasyBakeException helps distinguish whether or not it should be displayed to the user; Exception class `error_type` attributes are now applied to the class via decorator instead of to the instance via init; Fixed easybake errors looking for the old json response format; Fixed incorrect error bubble when deleting a synonym after the tag has already been deleted
2017-03-04 22:27:24 -08:00
888c3b48cd
Completely revise exception message formatting technique
2017-03-04 21:56:23 -08:00
b9b1879179
Make /tags.json return tag objects instead of just easybake text
2017-03-04 19:59:16 -08:00
edc2ae2768
Give thumbnails a checkerboard bg for transparent images
2017-03-04 19:27:03 -08:00
83408aca4a
Give Albums their own ID counter, own group rel table
2017-03-04 01:13:22 -08:00
415d858e20
Fix toplevel albums not getting digest children; prefix album zips with 'album '
2017-03-03 23:44:43 -08:00
92880ba3eb
Rearrange mimetype-icon dict for clarity
2017-03-03 22:50:36 -08:00
73835e2a7a
Separate concerns: updating given parameters vs rendering dict to param string
2017-03-03 22:11:29 -08:00
c3a4fa443b
Rename variable 'row_tuple' to 'db_row'; Improve some docstrings
2017-03-03 21:15:31 -08:00
75ee476abf
minor visual fixes
2017-03-02 16:56:18 -08:00
9ba1a88174
Fix bug in which only the last photo of a digest was added; Improve mimetype usage by not deleting the subtype
2017-02-27 23:39:06 -08:00
c6615284e0
Improve Photo Card CSS: Filename hover and metadata font
2017-02-27 23:05:43 -08:00
fcc671a617
Move many errors + warnings to properties of Exception classes
2017-02-26 01:04:07 -08:00
5d1c2dfc40
Use URL to indicate POST action
...
Instead of passing 'action' as a field like a dummy.
2017-02-26 00:33:26 -08:00
5404a1d411
checkpoint
...
fix bug in which renaming photo causes os.remove even when it's an in-place rename on case-insensitive systems; incorporate expressionmatch for filename search; minor comment cleanup
2017-02-25 22:47:20 -08:00
c80e2003ff
checkpoint
...
add photo and search css for narrow screens; incorporate new expressionmatch kit; entry_with_history cursor moves to end; albums indicate total filesize; etc
2017-02-24 22:07:59 -08:00
80cb66b825
Rename phototagger.py to photodb.py
2017-02-04 20:01:03 -08:00
c84acca6c9
Move modules into an actual package
2017-02-04 19:55:13 -08:00
2b34854910
Move files to top of repository
2016-11-28 20:19:31 -08:00
2d4b07c10f
Add database upgrader script
2016-11-28 20:18:44 -08:00
45a8a8ccc5
checkpoint
2016-11-27 01:06:11 -08:00
df028c2354
checkpoint
2016-11-07 21:06:28 -08:00
58eb50dfb2
list view
2016-11-06 18:00:30 -08:00
5de1736347
checkpoint
2016-11-05 21:24:43 -07:00
7ad6160d38
album .tar
2016-11-05 17:58:37 -07:00
c493362520
add override filename
2016-10-30 14:42:09 -07:00
9a327e6082
checkpoint
2016-10-30 14:20:46 -07:00
25a4b69cd8
checkpoint
2016-10-29 18:46:23 -07:00
198900c990
checkpoint
2016-10-20 20:15:24 -07:00
de60770d20
checkpoint
2016-10-17 22:13:12 -07:00
0b85c309f8
checkpoint
2016-10-09 20:50:13 -07:00
6c5580c1bc
checkpoint
2016-09-18 01:33:46 -07:00