5.6 KiB
5.6 KiB
Changelog
0.2.4 (pre-release)
Library filename templates, tag category fetching for all backends, and a popout video streaming overhaul. 50+ commits since v0.2.3.
Changes since v0.2.3
New: library filename templates
Save files with custom names instead of bare post IDs. Templates use %id%, %artist%, %character%, %copyright%, %general%, %meta%, %species%, %md5%, %rating%, %score%, %ext% tokens. Set in Settings > Paths.
- New
core/library_save.pymodule with a singlesave_post_fileentry point. All eight save sites (Save to Library, Save As, Bulk Save, Batch Download, and their bookmarks-tab equivalents) route through it. - DB-backed
library_meta.filenamecolumn tracks the rendered name per post. Non-breaking migration for existing databases. - Sequential collision suffixes (
_1,_2,_3) when multiple posts render to the same filename (e.g. same artist). - Same-post idempotency via
get_library_post_id_by_filenamelookup. Re-saving a post that already exists under a different template returns the existing path. find_library_filesanddelete_from_libraryupdated to match templated filenames alongside legacy digit-stem files.is_post_in_library/get_saved_post_idsDB helpers replace filesystem walks for saved-dot indicators. Format-agnostic.reconcile_library_metacleans up orphan meta rows on startup.- Saved-dot indicators fixed across all tabs for templated filenames.
- Library tab single-delete and multi-delete now clean up
library_metarows (was leaking orphan rows for templated files). - Save As dialog default filename comes from the rendered template instead of the old hardcoded
post_prefix. - Batch downloads into library folders now register
library_meta(was silently skipping it). - Bookmark-to-library copies now register
library_meta(was invisible to Library tag search). - Cross-folder re-save is now copy, not move (the atomic rename was a workaround for not having a DB-backed filename column).
New: tag category fetching
Tag categories (Artist, Character, Copyright, General, Meta, Species) now work across all four backends, not just Danbooru and e621.
- New
CategoryFetchermodule with two strategies: batch tag API (Gelbooru proper with auth) and per-post HTML scrape (Rule34, Safebooru.org, Moebooru sites). - DB-backed
tag_typescache table. Tags are fetched once per site and cached across sessions.clear_tag_cachein Settings wipes it. - Batch API probe result persisted per site. First session probes once; subsequent sessions skip the probe.
- Background prefetch for Gelbooru batch API path only. search() fires
prefetch_batchin the background when_batch_api_worksis True, so the cache is warm before the user clicks. - Danbooru and e621
get_postnow populatestag_categoriesinline (latent bug: was returning empty categories on re-fetch). categories_updatedsignal re-renders the info panel when categories arrive asynchronously._categories_pendingflag on the info panel suppresses the flat-tag fallback flash when a fetch is in progress. Tags area stays empty until categories arrive and render in one pass.- HTML parser two-pass rewrite: Pass 1 finds tag-type elements by class, Pass 2 extracts tag names from
tags=NAMEURL parameters in search links. Works on Rule34, Safebooru.org, and Moebooru. save_post_fileensures categories before template render so%artist%/%character%tokens resolve on Gelbooru-style sites.- On-demand fetch model for Rule34 / Safebooru.org / Moebooru: ~200ms HTML scrape on first click, instant from cache on re-click.
Improved: popout video streaming
Click-to-first-frame latency on uncached video posts with the popout open is roughly halved. Single HTTP connection per video instead of two.
- Stream-record. mpv's
stream-recordper-file option tees the network stream to a.parttemp file as it plays. On clean EOF the.partis promoted to the real cache path. The parallel httpx download that used to race with mpv for the same bytes is eliminated. Seeks during playback invalidate the recording (mpv may skip byte ranges); the.partis discarded on seek, stop, popout close, or rapid click. - Redundant stops removed.
_on_video_streamno longer stops the embedded preview's mpv when the popout is the visible target (was wasting ~50-100ms of synchronouscommand('stop')time)._apply_load_videono longer callsstop()beforeplay_file(loadfile("replace")subsumes it). - Stack switch reordered.
_apply_load_videonow switches to the video surface before callingplay_file, so mpv's first frame lands on a visible widget instead of a cleared image viewer. - mpv network tuning.
cache_pause=no(stutter over pause for short clips), 50 MiB demuxer buffer cap, 20s read-ahead, 10s network timeout (down from ~60s). - Cache eviction safety.
evict_oldestskips.partfiles so eviction doesn't delete a temp file mpv is actively writing to.
Bug fixes
- Popout close preserves video position.
closeEventnow snapshotsposition_msbefore dispatchingCloseRequested(whoseStopMediaeffect destroys mpv'stime_pos). The embedded preview resumes at the correct position instead of restarting from 0. - Library popout aspect lock for images. Library items' Post objects were constructed without width/height, so the popout got 0/0 and
_fit_to_contentreturned early without settingkeep_aspect_ratio. Now reads actual pixel dimensions viaQPixmapbefore constructing the Post.
Other
- README updated, unused Windows screenshots dropped from the repo.
- Tightened thumbnail spacing in the grid from 8px to 2px.