feat: 0.9.7 — Home + Settings Storage from disk truth
Replaces the unreliable DB SUM(file_size_bytes) for the Home and Settings
"Storage used" displays. On legacy libraries thousands of rows have
file_size_bytes stuck at 0 (older download paths didn't populate it; the
recovery backfill failed on orphaned rows + SAF content:// path
mismatches). The new path walks the actual filesystem and reports disk
truth.
Changes:
- FileOrganizer.computeMusicLibrarySize() — storage-mode-aware walker.
Internal filesDir/music walk for default users; SAF DocumentFile
traversal for users on external storage. Returns total bytes +
lossless-codec subset (count + bytes). - LibrarySizeHolder — @singleton wrapping a StateFlow
driven by MusicRepository.getTrackCount() changes. scan(prev) preserves
last-good values across walk failures; WhileSubscribed(5s) pauses the
walker when no UI observes. - HomeViewModel + SettingsViewModel both observe the holder. Both screens
now show the same correct Storage value (~16 GB on a typical legacy
library; was 4.4 GB pre-fix in Settings).
Cold-start UX: the StateFlow shows 0 GB until the first walk completes
(1-2 minutes for SAF / ~3000 files; instant for internal). Persisting the
last-known size across app restarts is deferred.
Specs:
- docs/superpowers/specs/2026-05-03-library-size-holder-design.md
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Install
Download the .apk below and open it on your Android device. If you've got a previous Stash release installed, this upgrades in place — your library, sync history, and settings are preserved.
Requires: Android 8.0 (API 26) or newer.
See the README for first-time setup.
Full Changelog: v0.9.5...v0.9.7