A one-track retag or an empty rescan refetches the whole track list #282

Open
opened 2026-10-06 02:40:29 +00:00 by yonlu · 1 comment
Owner

TrackMetadataChanged and LibraryScanComplete both make library-store drop and refetch the whole track list (invalidate()), however few files changed. A one-track tag save refetches 20.5 MB at 26 138 tracks; so does a soft rescan that found nothing.

TrackPlayCountChanged and TracksRemovedFromLibrary already patch in place because their payloads carry enough to do it. The tag writer already knows the paths it wrote (the single-track event even carries filePath); a scan knows what it inserted, updated and removed.

Proposed

  • Events carry the changed paths (bounded; above a threshold they say full instead).
  • library-store refetches only those rows (through the payload format, scoped to paths), splices them in, and refetches only the small collections.
  • Full refetch stays as the fallback for full, a library switch, and a fetch in flight.
`TrackMetadataChanged` and `LibraryScanComplete` both make `library-store` drop and refetch the whole track list (`invalidate()`), however few files changed. A one-track tag save refetches 20.5 MB at 26 138 tracks; so does a soft rescan that found nothing. `TrackPlayCountChanged` and `TracksRemovedFromLibrary` already patch in place because their payloads carry enough to do it. The tag writer already knows the paths it wrote (the single-track event even carries `filePath`); a scan knows what it inserted, updated and removed. ### Proposed - Events carry the changed paths (bounded; above a threshold they say `full` instead). - `library-store` refetches only those rows (through the payload format, scoped to paths), splices them in, and refetches only the small collections. - Full refetch stays as the fallback for `full`, a library switch, and a fetch in flight.
yonlu self-assigned this 2026-10-06 02:40:44 +00:00
yonlu added the
Status
In Progress
label 2026-10-06 02:40:45 +00:00
Author
Owner

Plan 023 (scoped library payloads), in order 279 → 281 → 280 → 282, then 283 and 284. Measured before/after with make perf against the bulk seed.

Plan 023 (scoped library payloads), in order 279 → 281 → 280 → 282, then 283 and 284. Measured before/after with make perf against the bulk seed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yonlu/yellowjacket#282