Commit Graph
491 Commits
Author SHA1 Message Date
austinried 64ec3265b7 ui: reject stale and mixed-generation queue edits 2026-11-14 12:05:29 +00:00
austinried 9514bc501a downloads: reconcile bulk deletion as one batch 2026-11-14 12:05:29 +00:00
austinried 35f4f9178b downloads: adapt reset tests to prepared publication 2026-11-14 12:05:29 +00:00
austinried e4d97f7aba downloads: harden queue reset reconciliation
Refresh per-source rows under the reconciliation mutex before reset decisions and chunk queue-visibility checks to respect SQLite bind limits.

Cover a blocked pre-completion emission and source deletion at the bundled SQLite variable limit.
2026-11-14 12:05:29 +00:00
austinried cc94dfc458 downloads: reconcile visible queue reset baselines
Consume captured reset points on the first collector emission and leave pending sources uninitialized during reconciliation.

Build ordered baselines from queue-visible completed downloads and ignore pruned-row transitions while retaining all-row state and recovery.
2026-11-14 12:05:28 +00:00
austinried 79915d6c7a library: skip queue resets for missing songs 2026-11-14 12:05:28 +00:00
austinried 4e72b1f38d downloads: preserve completed reset baselines 2026-11-14 12:05:28 +00:00
austinried ed19ca2ece library: reconcile queues after starred and download changes 2026-11-14 12:05:28 +00:00
austinried 481f12c892 sync: preserve legacy identity during queue resets 2026-11-14 12:05:28 +00:00
austinried 544b442f4e sync: make queue reset publication recoverable 2026-11-14 12:05:28 +00:00
austinried 705c93053f sync: publish queue resets after commit
Prepare queue and playback reconciliation inside the reset transaction without publishing listener, cache, or revision state. Publish through a non-suspending, non-cancellable post-commit step so committed resets are never retried over later edits.

Keep the pending-origin clear under the cursor lock without a redundant single-statement transaction, and cover listener and post-clear write failures.
2026-11-14 12:05:28 +00:00
austinried 95c8a2a915 sync: preserve queue lock order during resets
Move pending-origin clearing into the queue mutation lock, acquire the cursor lock before Room, and clear pending rows before cache, revision, or listener side effects. Keep sync listener reconciliation transactional for retries while preserving direct reset commit visibility.
2026-11-14 12:05:28 +00:00
austinried 2afad4fa0d sync: verify updates recreate pending origins 2026-11-14 12:05:28 +00:00
austinried 4e51f906fe sync: consume pending origins with queue resets 2026-11-14 12:05:28 +00:00
austinried 548bf39136 sync: reset queues only for successfully changed origins 2026-11-14 12:05:28 +00:00
austinried acc820e263 playback: reconcile detached items during offline transitions 2026-11-14 12:05:28 +00:00
austinried 4b5d02f17b playback: keep detached fallback out of published position 2026-11-14 12:05:28 +00:00
austinried fd0eb0a9a0 playback: retain durable reset identity through Media3 2026-11-14 12:05:28 +00:00
austinried a9738c6311 playback: preserve detached fallback queue state 2026-11-14 12:05:28 +00:00
austinried 767c3db1ae playback: serialize transitions and preserve detached playback
Run transition bookkeeping under the queue mutation lock, retain detached playback when its final survivor is removed, and restore offline repeat wrapping without a forward survivor. Centralize detached survivor rebuilding and add regressions for each defect.
2026-11-14 12:05:28 +00:00
austinried 018f30a3d8 playback: preserve playback across canonical queue resets 2026-11-14 12:05:28 +00:00
austinried 762639cab5 queue: invalidate keyset cursors on edits 2026-11-14 12:03:42 +00:00
austinried 94c7fba536 queue: preserve ambiguous legacy reset identity 2026-11-14 12:03:42 +00:00
austinried ddc6811c34 queue: suppress shuffled context removal 2026-11-14 12:03:42 +00:00
austinried 04dba5ef76 queue: leave ambiguous migrated fragments unreset 2026-11-14 12:03:42 +00:00
austinried 0448842f60 queue: retain reset identity across duplicate edits 2026-11-14 12:03:42 +00:00
austinried b9085af44c queue: preserve fragmented origin entry identity 2026-11-14 12:03:42 +00:00
austinried 44e2eb7ae8 queue: add serialized, origin-aware mutations 2026-11-14 12:03:42 +00:00
austinried 02404ef562 ui: rename the song tap preference 2026-11-12 13:03:41 +00:00
austinried d05fb6fc07 playback: resolve the pending tap preference inside the start lock 2026-11-12 07:53:06 +00:00
austinried 2bbff7e477 playback: take the start lock before reading the tap preference 2026-11-12 07:39:14 +00:00
austinried e94b365495 playback: make the song tap shuffle behaviour a preference 2026-11-12 07:05:20 +00:00
austinried 29335f7ddf playback: turn off shuffle when a song is tapped 2026-11-12 04:31:58 +00:00
austinried 11276c2e1f playback: revert the restored session prepare
Preparing the restored window on launch was meant to make the paused
session reachable from Bluetooth and Automate. The follow-up on the issue
shows the notification appears, but the car's play command still does not
reach the app until the phone is unlocked, and the speculative prepare
buffered up to 50 seconds of the restored track on every launch while
claiming the media controls whenever the app opened.

Removing the prepare also removes the error gate it needed, which could
hide genuine playback errors while paused.

Reverts #230.
2026-11-05 13:13:22 +00:00
austinried eb55858cc4 playback: preserve null keys and ranged duplicate ranks 2026-11-04 13:15:54 +00:00
austinried 95ad993996 playback: resolve shuffled windows without flat ID lists 2026-11-04 13:06:45 +00:00
austinried 11abd4afbd ui: share bulk download deletion confirmation 2026-11-04 12:16:06 +00:00
austinried 09baaeb77d playback: keep speculative prepare failures quiet
A restore now prepares the saved window before any play gesture, so a
network failure at launch reached the error listener and showed a toast
even though the user had not asked to play. Only report playback errors
when playback was requested.

The new tests now wait for the prepare operation rather than the window
contents, which can be observed a poll before the prepare lands.
2026-11-04 11:12:07 +00:00
austinried 484cc55385 playback: prepare the restored queue so the session starts on launch
Restoring the saved queue left the player idle, so the media session had no
notification and Bluetooth or Automate saw no active player until playback
began. Prepare the restored window without autoplaying, which surfaces the
paused session when the app opens. A queue from another source stays stopped,
and an offline queue without downloads has no window to prepare.

Closes austinried/subtracks#202
2026-11-04 11:12:07 +00:00
austinried 599924bdd0 test: share Room database and repository fixtures 2026-11-04 11:08:31 +00:00
austinried b2a1716be2 library: generate artist credit queries from one definition 2026-11-04 10:11:17 +00:00
austinried 51792f836b test: wait for the repository's active source in artist art tests
awaitActiveSourceId() watched the DAO's activeSourceId flow, which turns
non-null as soon as the source row is written. SourceRepository sets its
in-memory active source in a separate collector, so artistImage() could
still see null and the online URL assertion failed. Wait on the
repository's own activeSource readiness signal instead.
2026-11-03 09:08:54 +00:00
austinried c3a5382c27 db: bind named parameters directly and cover the repository dispatch
SQLite gives a repeated named parameter one index, so rawQuery can pass the
SQL through unchanged and bind the distinct names in first-appearance order
instead of rewriting them to positional placeholders.

Use named arguments for the repository dispatch, since the adjacent
descending/downloaded booleans were easy to transpose, and add a repository
test that collects the downloaded album grid. Fix the query-timing labels so
the unqualified rows measure the same default path as before.
2026-11-03 01:03:45 +00:00
austinried 6f1e05d15a db: carry the sort-name mode through the paging builders
Rebase follow-up for the new SortNameMode preference: pass it into the
shared album/artist order functions so downloaded pages honour it too,
cover the new _plain indexes in the downloaded artist plan test, and add a
downloaded-mode ordering test.
2026-11-03 01:03:45 +00:00
austinried c165a6cc88 db: pin the downloaded artist count access path in the plan test
Assert the sourceId index as well as the in-memory sort for the downloaded
Artist album count order, and fold the top-level plan helper into plan().
2026-11-03 01:03:45 +00:00
austinried 18c24ca566 db: cover downloaded paging invalidation and filters
Add tests for the downloaded artist and playlist paging sources now that
their observed entities are hand-picked, and assert the downloaded
search/starred filters directly. The downloaded artist plan test uses the
real select list and documents the computed album count's in-memory sort,
which the hand-written query also had.
2026-11-03 01:03:45 +00:00
austinried 8d6f7e2341 db: collapse paged library queries into one builder per entity
Replace the thirty hand-written order variants with one query builder per
entity plus a default and a downloaded @RawQuery entry point. The
repository's sort dispatch trees and the duplicated positional filters in
LibraryPaging are gone, and the SQL now lives in multi-line strings with
named parameters.

The generated statements are identical to the previous ones modulo
whitespace: the downloaded variants keep the same CASE/download conditions,
and the observed entities match what Room inferred for the old queries. A
small helper rewrites the named parameters to RoomRawQuery's positional
form, including the repeated :sourceId bindings.
2026-11-03 01:03:45 +00:00
austinried d7a3a41ab2 metadata: refresh the artist screenshot with the new biography
Regenerate the store screenshots from the demo library. Only the artist
page changed meaningfully, so keep that capture, using Nine Inch Nails,
which has a biography and three albums.

The demo test now fetches the artist biography and passes artist art to
the home, library and search screens, so a regeneration keeps their art
instead of falling back to letter placeholders.

The captures now come from a 393x786 dp, 440 dpi phone: Pixel XL's
640x360 dp renders text far larger than a real phone shows it. That
phone renders 1080x2161, one pixel over the 2:1 limit both stores
enforce, so captures are written out at 1080x2160.
2026-10-24 02:16:45 +00:00
austinried f9151843a6 Revert "ui: show the singular and plural artist rows separately"
This reverts commit 2f95a89682.
2026-10-21 14:24:48 +00:00
austinried 2f95a89682 ui: show the singular and plural artist rows separately
Track info now lists the Artist field and the plural Artists field as
their own rows, hiding Artists when it would repeat the Artist value.
Keep one Artist sort row, also hidden when it matches the artist name.
2026-10-21 14:24:18 +00:00