5 Commits
Author SHA1 Message Date
zarzet 6e07941b35 feat(library): save network songs offline with independent copies 2026-11-03 03:18:14 +07:00
zarzet 9d11f9b883 perf(library): restrict filtered album aggregates
Aggregate only album keys that can survive the active filter while keeping full-album counts and sort dates. Preserve the established album page results across source, FTS, shadow, sort and cursor combinations.

With the supporting artist indexes, the 15,000-row host aggregate measured 6.190 ms before and 0.456 ms after. Pin the changed SQL shape and retain the old row-result digests.
2026-11-01 19:41:07 +07:00
zarzet f5e4819362 perf(library): read the download shadow check from a TEMP snapshot
Every Library read over scanned songs checked, row by row, whether a
download holds the same file: each of the row's path keys (about 40 per
song on Android) was probed against History. That check was most of the
cost of the tab counts, the album and artist pages, the Folders index,
search, the Home mix pages and the Autoplay sample, and the album
completeness filters also scanned the whole Library once per download.

LibraryDatabase now keeps the matching pairs of Library and History rows
in a connection-local TEMP table. It is rebuilt only after PRAGMA
data_version of either database (a commit by another connection) or
total_changes() (a write on this one) has moved, with DDL only, so the
rebuild itself writes no rows. Each read checks the stamp again after
its query and repeats the query with the per-row check if anything was
written in between, so results equal today's SQL. Without a stamp the
per-row check stays in use; the default SQL is unchanged.

Android key profile, 15,000 scanned songs and 5,000 downloads (host
SQLite 3.54): tab counts 302 -> 13 ms, album page 309 -> 22 ms, artist
page 250 -> 15 ms, Folders 869 -> 65 ms, Home mix pages 2.7 s -> 0.19 s,
Autoplay sample 2.2 s -> 0.40 s, Incomplete albums over 60 s -> 0.33 s.
A rebuild costs about 0.44 s there (0.02 s on the desktop profile) and
runs once per write.
2026-10-31 01:20:41 +07:00
zarzet 44cbb57b30 refactor: import moved files directly and remove the re-export shims
Eight one-line re-export files remained from an earlier move into controllers, models and providers. Every import now points at the real file, so the shims are deleted.
2026-10-24 03:27:23 +07:00
zarzet 057e879f04 test(library): pin the generated queue Library SQL
Records the SQL and bound arguments of every track, album, count and artist
query across sort modes, filters and page shapes, so refactors of the queue
store cannot silently change Library ordering or filtering.
2026-10-23 22:28:47 +07:00