Commit graph

129 commits

Author SHA1 Message Date
d66dc53215 Require voussoirkit 0.0.28 for sqlhelpers.listify.
Instead of defining that within etiquette.
2019-01-01 18:08:47 -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
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
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
e9f567ffc9 Don't allow Groupable to add itself as a child.
omg what an oversight
2018-09-22 23:14:41 -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
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
1b90850818 Oops, add the required_feature decorators to remove_child. 2018-07-22 21:06:16 -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
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
64449569ea Rearrange statements during tag delete to not voilate FK. 2018-05-03 18:59:50 -07:00
23cc769357 Take advantage of parent's cached_qualname when making mine. 2018-05-03 18:45:57 -07:00
943deb9bf7 Move child-lifting code to its own helper method. 2018-05-03 18:32:44 -07:00
a0e3e037c1 Bail out of join_group early if already immediate parent.
I'd rather make the extra select than a delete and reinsert.
2018-05-03 18:18:13 -07:00
22269af2ca Always use False for leave commit before joining new group. 2018-05-03 18:10:12 -07:00
58d450a856 Fix handling of the event that a file loses its thumbnail.
In which case return_filepath is None and the relative_to breaks.
2018-05-01 20:41:38 -07:00
48396d6ab6 Add Album.remove_photos for batch removals. 2018-05-01 18:05:07 -07:00
698981dd29 Move _uncache_sums call out of _add_photo, into callers. 2018-05-01 17:48:56 -07:00
97e1f881d0 Move video thumbnailing code to helpers. 2018-04-28 20:36:33 -07:00
5bc2bbdacb Move image thumbnailing code to helpers. 2018-04-28 20:33:05 -07:00
41823394eb Use PDB.get_albums_by_id for Photo.get_albums. 2018-04-28 19:17:11 -07:00
62496d183e Use PDB.get_tags_by_id for Photo.get_tags. 2018-04-28 19:14:58 -07:00
b19682d1a5 Replace Photo.sorted_tags with jinja filter. 2018-04-28 19:05:51 -07:00
fec5eaf21e Add Tag.normalize_name to be called by PDB.normalize_tagname. 2018-04-20 15:28:27 -07:00
21bd211889 Give Users a display_name. 2018-04-15 14:23:24 -07:00
8562b355ce Fix typo in debug commit message. 2018-04-15 13:49:10 -07:00
7d8b8daeba Rewrite Album.sum_bytes to use SQL sum in a single query. 2018-04-15 02:52:41 -07:00
f77ab51b14 Add Album.has_any_photo and has_any_subalbum_photo. 2018-04-15 02:41:24 -07:00
518a45ccd8 Add method get_things_by_id for mass lookups. 2018-04-15 02:14:06 -07:00
0094e7c006 Fix bug where add_tag supersedence caused early commit. 2018-04-15 01:14:20 -07:00
bfc4f313a9 Switch some formats to f-strings. 2018-04-15 01:13:02 -07:00
144e97d365 Use self.photodb.sql_ methods instead of running own cursors.
All in the name of centralization.
Also improved SQLness of Tag.convert_to_synonym.
2018-03-29 19:24:48 -07:00
cca8837863 Move helpers.select_generator to PDB.sql_select. 2018-03-25 16:32:17 -07:00
da47b5bb3c Fix several small, embarassing typos. 2018-03-23 01:18:43 -07:00
229530580f Add Tag.normalize_description. 2018-03-23 00:35:56 -07:00
b4d3de3651 Add Bookmark.normalize_title and _url. 2018-03-23 00:35:56 -07:00
6ee86431e5 Add Album.normalize_title and _description. 2018-03-23 00:35:55 -07:00
dddd8a3aa1 Add ObjectBase.normalize_author_id. 2018-03-23 00:35:47 -07:00
60049c777f Add method get_author to all objects. 2018-03-18 15:58:51 -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
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
1cd78a678b Minor linter appeasements. 2018-03-11 01:54:59 -08:00
a86c27ceb4 Simplify some unnecessarily detailed log formats. 2018-03-11 01:34:32 -08:00
94e518068f Add Album.add_photos for batch adding with less savepoint waste.
Because each call to add_photo opens a savepoint, it is wasteful
to use it for a large number of photos that belong together.
2018-03-10 22:50:41 -08:00