Skip to content

Commit f5058a0

Browse files
committed
Version 639
closes #1790
1 parent c3cb88c commit f5058a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2254
-1755
lines changed

docs/changelog.md

Lines changed: 49 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,55 @@ title: Changelog
77
!!! note
88
This is the new changelog, only the most recent builds. For all versions, see the [old changelog](old_changelog.html).
99

10+
## [Version 639](https://github.com/hydrusnetwork/hydrus/releases/tag/v639)
11+
12+
### misc
13+
14+
* `system:number of tags` and `system:tag as number` have a nicer new namespace selection widget
15+
* fixed the duplicate filter group mode finding a new group after the previous group was resolved. I messed this up in last week's rewrite and it slipped through testing
16+
* huge multi-column lists handle large selections much more efficiently, particularly when they have lots of buttons. all the various logic that handles 'should this accompanying button be enabled?' and so on now uses calls that work much faster when there are thousands of items selected. in my tests, a sublist with 5,000 test items now updates to a new selection in under 30ms--previously it was about a second. similarly, pasting all those items to a new list now takes about six seconds, whereas previously it was locking up for ages and ages, perhaps forever (issue #1737)
17+
* fixed an issue where the 'move media files' dialog was saying all files were in their ideal location if the thumbnail location override was not set. this was happening because an error was being quashed over-eagerly. if this dialog has a similar problem in future, you might get some spammy reports, but it'll show. also a side thing, the 'set' button of the thumbnail location override no longer disables if you have a path set--feel free to move it to a new location in one step mate
18+
* the system that positions windows off the topLeft corner of their parent is now more forgiving of unusual window manager frame geometry. if you kept getting 'hey I just rescued a window from ( 24, -14 )'-style popups every time you open the options off a maximised main GUI, let me know what happens now--are your dialogs appearing offscreen, auto-repositioning to (0, 0), or is everything good now?
19+
* if you are feeling clever and can get an OR predicate into the duplicates auto-resolution 'test A or B' comparator, it now works! I'll brush up the UI in future to make it easy to enter an OR here (issue #1790)
20+
21+
### potential duplicates discovery
22+
23+
* I have overhauled the daemon that looks for new potential duplicate pairs. this guy no longer searches for pairs during shutdown maintenance (I'm generally trying to retire shutdown work), but you can now tell it to run in idle and/or normal time, with separate work/rest settings under `options->maintenance and processing`
24+
* your settings here will mostly reset to defaults this week, sorry! default is to run in idle time but not active time, with some conservative work/rest ratios
25+
* a critical section of database code that finds outstanding eligible files to perform the similar files search on is now optimised for clients with larger numbers of files. there will be a one-time CPU cost for each search distance you run at, and thereafter this thing should run like greased lightning even if you have millions of files, reducing per-job overhead for all similar files search
26+
* when you force work through the duplicate page 'preparation' tab, it now works through a pause/play button and there is no separate work popup; it now just updates the bar in front of you
27+
* I'm interested to know how 'run in normal time' feels for clients that have a lot of imports going on. I haven't gone for instant reaction to new files yet, but if it is idling with all other work done it'll get to any new files within about ten seconds, and the auto-resolution system _will_ react instantly to new potential duplicate pairs. might be laggy, might be cool, might be confusing as files in downloader pages are deleted before your eyes. the super ideal here would be to collapse the whole operation into the single import job and return something like 'file was duplicate' instead of 'already in db' as the import status, but we'll see how this does
28+
* the 'reset potential search' cog-button task now resets the search for all eligible files. previously, I was trying to be cute and only reset search for files that previously found a potential pair, but the, say, ~37% filled progress bar after reset was confusing and not actually what the maintenance task wanted. KISS
29+
30+
### profile mode
31+
32+
* `help->debug->profiling->profile mode` now works on Python 3.12+. newer version of python are more strict about how profiling operates in a multi-threaded environment, and hydrus's profiling now obeys these rules. it turns out hydrus was always getting some _slightly_ gonk numbers here in busy multi-threaded situations, or at least many jobs were being truncated, which explains some inexplicable results I've seen over the years
33+
* profile mode is now split into four exclusive types--client api, db, threads, and ui. the menu and html help are updated to talk about these. most users will want 'db'
34+
* 'threads' and 'client api' profiles will sometimes include a bunch of truncated 'EXCLUSIVE: (job) ran in 17ms'. this is me salvaging a difficult situation with a still-useful number. don't worry about it!
35+
* Python 3.12+ adds some cool tools here, and I expect to expand to some 'profile everything going on mate' modes in future to capture deep Qt things my specific modes do not
36+
* there's an ancient shortcut for 'turn profile mode on'. this now does 'db' profile mode; it'll probably do something else later, or I'll retire it
37+
38+
### boring stuff
39+
40+
* if you boot the client or server in a python environment that does not have the requirements.txt stuff installed, the client now recognises this and gives a nicer error saying 'hey, I think you need to reinstall/activate your venv', rather than the old 'hey you don't have yaml' error
41+
* tweaked the client's critical boot error handling so that it shows a nicer english error message first and then the full traceback in a second dialog
42+
* added some unit tests for OR predicates within Metadata Conditionals
43+
* fixed a deprecated unit test call. thanks to the user who pointed this out. this is not the first time this specific thing happened, so I'm switching up my testing regime to catch this in future
44+
45+
### boring overhauls and refactoring
46+
47+
* wrote a new MainLoop Manager for the potential duplicates search and some maintenance and numbers caching
48+
* overhauled the potential duplicates search tree maintenance call to have less overhead and be happier working in tiny chunks. it is now continually maintained throughout search work
49+
* wrote a count cache for the shape search store for the new daemon (previously it counted manually); it is updated as the underlying store changes
50+
* hooked up new notification paths for new shape search counts or brance rebalancing work. these paths are simple and comprehensive, so the new guy should be a bit more reliable for unusual file maintenance jobs and so on that may alter the search space a little
51+
* added some safety code to the new similar files search daemon to stop an infinite loop if the search record store has non-searchable items for some reason
52+
* cleaned up the Duplicates Page Sidebar maintenance page a bunch. there was just a ton of cruft to go through
53+
* to untangle some imports, moved duplicate score and visual duplicates gubbins out of `ClientDuplicates.py` to a new `ClientDuplicatesComparisonStatements.py`
54+
* collected pretty much all the profiling and query planner gubbins like start time and job count and printing tech from `HydrusController.py` and `HydrusGlobals.py` to `HydrusProfiling.py`. I cleaned a bunch of it up along the way
55+
* brushed up some of the database migration help r.e. missing locations and the pre-boot repair dialog
56+
* the core `CallAfter` method used by many thread-to-Qt comms is a tiny bit more stable/thread-safe
57+
* misc linting work, including clearing out some legacy unresolved references
58+
1059
## [Version 638](https://github.com/hydrusnetwork/hydrus/releases/tag/v638)
1160

1261
### misc
@@ -456,59 +505,3 @@ title: Changelog
456505
* fixed a client api test that could sometimes fail due to a thread taking too long to work
457506
* `help->about` now says the system architecture (e.g. x86_64, arm64, aarch64)
458507
* `help->about` has better wordwrap (we noticed it gets super wide if your install dir is long etc..)
459-
460-
## [Version 629](https://github.com/hydrusnetwork/hydrus/releases/tag/v629)
461-
462-
### misc
463-
464-
* fixed the regression where the top-right hover window was not showing in the archive/delete or duplicate filters (issue #1755)
465-
* fixed some volume/rating rendering stuff in the filters, too
466-
* the new '3/5' numerical ratings texts are now drawn in the normal text colour for your stylesheet, not from the rating colours
467-
* you can now select the 'aggregate modified time' as the source timestamp when setting up a sidecar export. this is the reasonable minimum of all known modified times and what you generally see in the UI when it only shows one modified time
468-
* if you try to import a Canon RAW CR3, it is no longer recognised in the initial path scanning routine as an mp4. many still images that ffmpeg can somewhat parse but isn't sure on should be fixed here--I was reading back the ffmpeg output badly and falling to a 'generic mp4?' assumption (issue #1756)
469-
* the optional library lines in `help->about` now say a little more than just True/False, and the process by which this dialog says 'hey, mpv failed to import for this reason' on window launch is now generalised, recognises the difference between a module not being available and an actual error during import, and covers mpv, QtCharts, QtPDF, dateparser, dateutil, and psutil
470-
* fixed 'collapse pages to the right' page tab actions, which were typo-broken in recent refactoring
471-
472-
### duplicates
473-
474-
* fixed an issue where the duplicates auto-resolution system would work way too hard and not take long enough breaks in many cases. it was notifying itself there was new work due _while_ doing work, leading it to keep waking itself up as soon as it went to sleep. it now ignores these signals while it is doing work. you will generally see the system working much slower from now on. let me know how this goes--now the clock behind all this isn't busted, it needs a re-tuning and/or options regarding how hard it wants to work, and we may want to bring back 'work hard' mode
475-
* the 'A and B are visual duplicates' test has a more sophisticated edge-detection routine. it can now detect paler watermarks or other artist edits by tiling the images' average edge differences and calculating a skew metric to notice unusual regional shifts
476-
* the duplicates auto-resolution system (and the database maintenance manager) now force breaks of at least 250ms between each job when things are busy
477-
* the duplicates auto-resolution system now runs with significantly less overhead any time it needs to consult rules
478-
* the list on the main duplicates filter 'auto-resolution' tab updates itself significantly faster now, only needing to hit the database on rule edits or the refresh button
479-
* rules are now better at reporting if they are doing work in this list. they'll say 'waiting' (want to work but settings say no working right now) and 'working' (taking available work slots right now) a lot more now. also instead of 'idle', they now say 'done'
480-
* the 'test' phase of a duplicates auto-resolution rule, which is CPU expensive for 'A and B are visual duplicates', now occurs outside the database transaction
481-
* fixed the 'work on these rules during idle time' cog menu, which was wired up to the 'do search for potential duplicates in idle time' options boolean due to a typo
482-
* the 'edit rules' dialog is now much more aggressive at interrupting and pausing ongoing work so it can launch
483-
484-
### more invalid export path fixes
485-
486-
* the new routine that elides subdirectory names generated by a export filename pattern is now careful to trim the directory name of leading/trailing whitespace. previously, when you were unlucky enough to get elided to `tag, tag, tag, `, the export operation would fail in Windows and simply be ugly everywhere else. the base filename is stripped of whitespace too, so you won't get `tag, tag, tag .jpeg` any more (issue #1751 again)
487-
* it now also removes periods from the end of windows file/dirnames, which it turns out are also not allowed
488-
* it now also excludes some windows reserved names like 'AUX' and 'COM1'
489-
490-
### AVIF
491-
492-
* the Pillow guys released the 11.3 that adds nice native AVIF support. all builds will fold this in and it should all just work. users who run from source might like to rebuild their venvs this week. this fixes some bugs we had with the interim plugin library, including one with unusual rotation (issue #1728)
493-
* in the v629 update, all AVIFs are scheduled for: a metadata rescan, the 'has exif/icc profile/other human-readable embedded metadata?' checks, and forced thumb, pixel hash, and phash regen (there are several legacy issues from this saga to catch up on)
494-
* the code that imports the heif, avif, and jpegxl plugin libraries now asks Pillow if it can do the respective thing (turns out it has a nice call for this) before importing the plugin, making for a much more natural and foolproof update process as we go forward here
495-
* the `help->about` window now shows if you have heif, avif, or jpegxl support natively in Pillow or via a plugin
496-
497-
### dateparser fixes
498-
499-
* dateparser, which we use to do the 'easy date parse' solution, updated to `1.2.2` and suddenly wouldn't import correct in the Linux and Windows builds (maybe macOS too, not sure, but it seems to have been a PyInstaller issue), breaking a bunch of cool date parsing
500-
* I have rolled back dateparser to `1.2.1` in all requirements files and it should import again ok in v629 builds. to check, you can see it under `help->about`
501-
* it looks like the new version had additional locale issues, too, or it aggravated an older known one. computers that are in locales where the local time is strictly 24-hour, such as Polish or Russian, were having trouble parsing any date with AM/PM info, even when I told dateparser 'hey, if that failed, just do it in EN mate'. the program now initialises dateparser right at the very start of the program, before other imports sink their teeth into app locale, and this appears to fix dateparser's timezone cache initialisation. thanks to the user who figured this out!
502-
* the 'easy date parse' system now has a fallback to dateutil's very good parser if dateparser fails
503-
* all the above addresses issue #1754
504-
505-
### cleanup/boring stuff
506-
507-
* fixed a deprecated Pillow fromarray mode param
508-
* think I fixed an issue with Arch running the Ubuntu-built release relating to a bad 'wakeUp' call in some event dispatching code
509-
* added some painter save/restore stuff to ensure 'draw rating here' calls are non-destructive to painter state
510-
* auto-resolution rules' counts are now updated at the object on any change and do not have to be reloaded when a daemon wants to consult them. also made it more thread-safe
511-
* added some sidecar modified timestamp unit tests
512-
* added unit tests for the new export path stuff, and improved my path unit tests to better work on any OS
513-
* deleted the old integrated 'do duplicates auto-resolution work' db code
514-
* removed the 'TEST: stop mpv on media transitions' option. this test failed and caused other bugs, but I have some other ideas I'm going to play with

docs/database_migration.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ A hydrus client consists of three components:
2929

3030
All of your jpegs and webms and so on (and their thumbnails) are stored in a single complicated directory that is by default at _install\_dir/db/client\_files_. All the files are named by their hash and stored in efficient hash-based subdirectories. In general, it is not navigable by humans, but it works very well for the fast access from a giant pool of files the client needs to do to manage your media.
3131

32-
Thumbnails tend to be fetched dozens at a time, so it is, again, ideal if they are stored on an SSD. Your regular media files--which on many clients total hundreds of GB--are usually fetched one at a time for human consumption and do not benefit from the expensive low-latency of an SSD. They are best stored on a cheap HDD, and, if desired, also work well across a network file system.
32+
Thumbnails tend to be fetched dozens at a time, and very randomly, so it is, again, ideal if they are stored on an SSD. Your regular media files--which on many clients total hundreds of GB--are usually fetched one at a time for human consumption and do not benefit from the expensive low-latency of an SSD. They are best stored on a cheap HDD, and, if desired, also work well across a network file system.
33+
34+
There are 256 file folders, named using the hexadecimal prefix of the files they store, from f00 to fff, and 256 thumbnail folders, from t00 to tff. Thus you should expect to have 512 folders total. This is likely to change in future to 4096/8192 (i.e. three hex chars).
3335

3436

3537
## these components can be put on different drives { id="different_drives" }
@@ -43,12 +45,7 @@ Backing such an arrangement up is obviously more complicated, and the internal c
4345
!!! danger
4446
**As always, I recommend creating a backup before you try any of this, just in case it goes wrong.**
4547

46-
If you would like to move your files and thumbnails to new locations, I generally recommend you not move their folders around yourself--the database has an internal knowledge of where it thinks its file and thumbnail folders are, and if you move them while it is closed, it will become confused.
47-
48-
??? note "Missing Locations"
49-
If your folders are in the wrong locations on a client boot, a repair dialog appears, and you can manually update the client's internal understanding. This is not impossible to figure out, _and in some tricky storage situations doing this on purpose can be faster than letting the client migrate things itself_, but generally it is best and safest to do everything through the dialog.
50-
51-
Go _database->move media files_, giving you this dialog:
48+
If you would like to move your files and thumbnails to new locations, hit _database->move media files_, giving you this dialog:
5249

5350
![](images/db_migration.png)
5451

@@ -77,6 +74,14 @@ While the ideal usage has changed significantly, note that the current usage rem
7774

7875
The current and ideal usages line up, and the defunct `C:\Hydrus Network\db\client_files` location, which no longer stores anything, is removed from the list.
7976

77+
!!! note "Missing Locations"
78+
If any of the 512 file/thumbnail media folders are not where the client expects them to be on program boot, a repair dialog appears to let you update the record. This is not impossible to figure out, _and in some situations doing this on purpose can be faster than letting the client migrate things itself_. I generally do not recommend moving folders around while the client is not up, but if you are feeling confident, go for it. You made a backup, right? :^)
79+
80+
Note that you cannot boot a client until it has located all the file subfolders.
81+
82+
Also, if your folders are in the 'wrong' locations but all those locations are known to the client, you will not get the repair dialog--it'll just give you a popup and shuffle its internal knowledge around.
83+
84+
8085
## informing the software that the SQLite database is not in the default location { id="launch_parameter" }
8186

8287
A straight call to the hydrus_client executable will look for a SQLite database in _install_dir/db_. If one is not found, it will create one. If you move your database and then try to run the client again, it will try to create a new empty database in that old location!

docs/launch_arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Disallows the 'custom assets' override that lets files in `db_dir/static` overri
7575

7676
##**`--profile_mode`**
7777

78-
This starts the program with 'Profile Mode' turned on, which captures the performance of boot functions. This is also a way to get Profile Mode on the server, although support there is very limited.
78+
This starts the program with 'Profile Mode' turned on, which captures the performance of boot functions. This is also a way to get Profile Mode on the server, although support there is very limited. Since Profile Mode is now split into different types, note this specifically turns on "db" Profile Mode.
7979

8080
# client-specific arguments
8181

0 commit comments

Comments
 (0)