Commit graph

315 commits

Author SHA1 Message Date
ad140e485e Two small docstring improvements. 2019-03-16 13:09:02 -07:00
d66dc53215 Require voussoirkit 0.0.28 for sqlhelpers.listify.
Instead of defining that within etiquette.
2019-01-01 18:08:47 -08:00
5d7bc1ff4b Somewhat improve prettiness of hyphen range parse code. 2018-12-27 15:31:56 -08:00
c6c6158062 Save this assignment until it's needed. 2018-12-21 23:44:50 -08:00
7674610b88 Somewhat simplify a few conditions in photodb init. 2018-11-24 22:25:25 -08:00
1eb5a6f465 Rename DatabaseOutOfDate's parameter 'current' -> 'existing'. 2018-11-24 22:06:16 -08:00
707fdcc637 Add album cards and improve album pages.
- album card has placeholder for future thumbnail.
- replaced nested tree hierarchy lists with separate boxes.
- list/grid view also applies to the root listing.
- added a sticky right panel for all the tools. not pretty yet.
- mechanism for adding sticky panel changed. instead of applying
  it to the #right, you apply it to #content_body so that its
  grid layout can be updated properly.
2018-11-12 22:15:59 -08: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
de48105e32 When thumbnailing, don't call relative_to on return.
The path given by make_thumbnail_filepath will already have
it in the right place, so this is probably an accident waiting
to happen.
2018-11-04 13:30:34 -08:00
25a27e6241 Move dict_to_params to flask-specific helpers.py.
The rest of etiquette has nothing to do with URLs so this
doesn't belong in the backend helper file.
2018-11-04 13:30:08 -08:00
20e41ad689 Extremely minor touchups. 2018-09-23 14:57:25 -07:00
95edc4d397 Add method Photo.move_file. 2018-09-23 14:54:56 -07:00
4d1575719b Bump voussoirkit requirement to 0.0.24 for pathclass exceptions. 2018-09-23 14:54:11 -07:00
e9f567ffc9 Don't allow Groupable to add itself as a child.
omg what an oversight
2018-09-22 23:14:41 -07:00
670bc8b375 Allow setting searchhidden during new_photo. 2018-09-21 21:31:57 -07:00
0ccfa74709 Let helpers.generate_*_thumbnail raise FileNotFoundError. 2018-08-17 22:05:47 -07:00
bea9f905bd Support downloading .zip of arbitrary photos, clipboard.
Now that creating zips of any photo set is easier, we can
let the user download whatever is on their clipboard.
2018-08-14 23:02:06 -07:00
bc6a0aa907 Improve & generalize zipfile code.
Moved some heavy lifting out of the flask album.zip endpoint
and into helpers.py.
Renamed some things for clarity.
2018-08-14 22:58:26 -07:00
53c86c30a1 Improve clarity of the recursive_dict_ helper functions & usage. 2018-08-11 18:19:55 -07:00
3b3c690ae3 Remove return value from load_config, so no illusion of purity.
This method already relies on object state anyway and writes back
to self.config, so the return value is unnecessary.
2018-08-11 18:19:10 -07:00
9eb9220ca9 Read and write the config file as UTF-8. 2018-08-11 17:57:19 -07:00
fb052a2d56 Fix Album.add_associated_directory not letting duplicates.
The docstring and the actual code were disagreeing.
2018-07-29 16:30:30 -07:00
30e3aa9c6f Simplify and improve rollback logic. 2018-07-29 16:28:57 -07:00
30d96139c2 Remove commit param from PDB.sql_* methods nobody was using.
And is better left to the caller anyway.
2018-07-29 16:05:49 -07:00
9328600355 Add message parameter to PDB.savepoint for better logging.
Helps to have a visual on which methods are creating the saves.
2018-07-29 16:03:04 -07:00
56e7472c93 Revert f-strings to %s for logging calls.
In my excitement I forgot about that rule.
2018-07-29 16:01:26 -07:00
8447fb3343 Make deleting and unlinking tags require confirmation.
Added text inside the delete buttons and made them confirm.
2018-07-28 20:25:25 -07:00
1b90850818 Oops, add the required_feature decorators to remove_child. 2018-07-22 21:06:16 -07:00
2a45f4e17e Add parameter albums to purge_empty_albums as starting set.
Like purge_deleted_files, you can provide a list of albums to
act as the starting point instead of letting it use the default
of all albums.
2018-07-22 20:21:00 -07:00
8a12a24e8e Add tag_autocomplete.js.
Instead of embedding the entire tag list in the search.html template
every single time, this script loads the tags from the new,
cache-enabled endpoint /all_tags.json. Then we can use html5
datalists to create autocomplete forms on the search and photo pages.
2018-07-22 20:19:05 -07:00
bbf07f4401 Fix image thumbnail wrong variable bug.
How long has that been there?
2018-07-22 20:19:05 -07:00
d740e6d686 Oops, fix read_filebytes not stopping at the range_max properly. 2018-07-22 20:18:58 -07:00
4c65ccaf68 Big! Liberate Groupables from strict heirarchy. Multiple parents.
I found that the strict heirarchy was not satisfying the situation
where one tag is the intersection of two others, but we can only
pick one as the parent

For example, does red_jacket belong under clothes.red_clothes or
clothes.jackets? A search for "red_clothes AND jackets" might
give us someone wearing red pants and a black jacket, so this
definitely needs to be a separate tag, but picking only one
parent for it is not sufficient. Now, a search for red_clothes
and a search for jackets will both find our red_jacket photo.

The change also applies to Albums because why not, and I'm sure
a similar case can be made.

Unfortunately this means tags no longer have one true qualname.
The concept of qualnames has not been completely phased out but
it's in progress.

This commit is very big because I was not sure for a long time
whether to go through with it, and so much stuff had to change
that I don't want to go back and figure out what could be grouped
together.
2018-07-20 13:09:06 -07:00
4987db4bd0 Switch to f-string formatting in many places. 2018-07-18 18:36:36 -07:00
4a39873fed Increase default tag cache to 10,000. 2018-07-18 18:27:18 -07:00
38bac41eb9 Add helpers.split_easybake_string for prelim parsing.
Helps to remove some distractions from the main easybake method.
2018-07-15 14:23:43 -07:00
f06b0915ab Add new_photo_kwargs to the create_or_get call.
Due to the closure, it was already working just fine, but I
want the explicitness of having it there.
2018-07-15 13:52:08 -07:00
57a9e0d4dc Move PDB.close out of the sqlmixin, into main class.
Doesn't really deserve to be with the sql stuff.
2018-07-15 13:27:04 -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
c930228d3f Rearrange order of Album.delete ops to not void FK contraint. 2018-06-30 12:51:09 -07:00
c736c33165 Add caching of tag synonyms. 2018-05-06 21:09:15 -07:00
c6b71f1a0d Revert caching of qualified names. Causing too many problems.
The world is just not ready for it. Was having issues about the
parents being deleted / renamed and needing to propogate those
changes in a not-ugly way.
Will reassess in the future.
2018-05-06 21:09:09 -07:00
0c8a57b6aa Make the assert methods public. 2018-05-06 21:09:09 -07:00
40c255b0d0 Pass object instantiations through a cacher.
I want the system to only have one instance of a particular
object at any time, so that we can effectively cache things
in them.
2018-05-06 21:09:08 -07:00
11fda94968 Make the SQL_COLUMNS code a bit easier to read. 2018-05-06 21:09:02 -07:00
db28b6819c Replace individual cache instantiations with all at once. 2018-05-06 21:08:56 -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
64449569ea Rearrange statements during tag delete to not voilate FK. 2018-05-03 18:59:50 -07:00