Commit graph

55 commits

Author SHA1 Message Date
1b308d7921 Fix seconds_to_hms bug!
Embarrassing. If M was zero then you got HH:SS.
2020-01-06 20:21:41 -08:00
3bd8fe6392 Raise FileNotFound from read_filebytes. 2019-12-10 12:48:28 -08:00
9fa49bbddf Add parameter only_shrink to fit_into_bounds. 2019-08-14 13:48:22 -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
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
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
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
30e3aa9c6f Simplify and improve rollback logic. 2018-07-29 16:28:57 -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
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
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
cca8837863 Move helpers.select_generator to PDB.sql_select. 2018-03-25 16:32:17 -07:00
0e3ae11610 Improve normalizers, use less None; Add author search box.
It was getting difficult to remember which of the normalizers
use None and which don't. So let's try to be a little more consistent
and just use empty sets, etc, so the caller can rely on receiving a
set instead of having to check for None.

Also renamed search parameter authors->author to be more in line
with the singular form of extension.
2018-03-22 21:09:21 -07:00
9a1caee412 Add helper function hash_file. 2018-03-18 20:56:29 -07:00
2d73e59abf Let helpers.read_filebytes operate on pathclass Paths. 2018-03-18 20:56:08 -07:00
1cd78a678b Minor linter appeasements. 2018-03-11 01:54:59 -08:00
d653673277 Update truthystring to return bool, not given int. 2018-02-24 23:01:44 -08:00
0228fbebfd Move the random hex generator to helpers. 2018-02-24 18:54:59 -08:00
606a66cbf9 Remove Photo.filepath and real_filepath in favor of real_path. 2018-02-17 15:19:36 -08:00
f7bd49b2dd Add call to remove_control_chars in remove_bad_pathchars. 2018-02-17 15:07:12 -08:00
ac9d7ede22 Rename Album.photos -> get_photos. 2018-02-16 23:03:54 -08:00
fdcf07940a Rename Groupable.children -> get_children. 2018-02-16 23:00:43 -08:00
1c1e7f158f Minor fixes & pylint appeasements. 2018-02-16 21:28:36 -08:00
dec28b321a Rename recursive_dict_update's parameters for clarity. 2018-02-03 01:10:54 -08:00
b5902ba4f1 Integrate voussoirkit sqlhelpers.
https://github.com/voussoir/else/tree/master/SQLHelpers
2018-01-09 21:15:50 -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
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
4f03815a30 Floating point hⓂ️s, and update to-do. 2017-06-11 21:09:17 -07:00
a5924b4642 I don't know how I forgot about dict(zip()) 2017-05-11 22:32:55 -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
b69ef8ea00 Cleanup some pylint 2017-03-23 15:11:28 -07:00
8793d9ff41 Fix docstrings over 80 characters 2017-03-19 17:34:19 -07:00
db628d158e Shorten lines longer than 100 characters 2017-03-14 21:18:42 -07:00
d7cd1e9748 Add more docstrings; Remove unused code 2017-03-10 15:01:12 -08:00
888c3b48cd Completely revise exception message formatting technique 2017-03-04 21:56:23 -08:00
edc2ae2768 Give thumbnails a checkerboard bg for transparent images 2017-03-04 19:27:03 -08:00
415d858e20 Fix toplevel albums not getting digest children; prefix album zips with 'album ' 2017-03-03 23:44:43 -08:00
73835e2a7a Separate concerns: updating given parameters vs rendering dict to param string 2017-03-03 22:11:29 -08:00