Project case study / Sona
Keeping a local music library recoverable
A Windows and Android music player that treats file identity, editable metadata and recoverable library state as part of the listening experience.

- My contribution
- Personal project · Flutter client and local-library workflow
- Project period
- 2026
- Scope
- Public preview · Windows & Android
From local files to a recoverable library
- Inspect files, tags and content hashes
- Organize the library and record edits
- Export a complete backup or same-device snapshot
- Verify and stage the recovery data
- Apply on restart with a rollback database
A library is more than its audio files
A personal music collection accumulates more than songs: corrected titles, favorites, playlists, artwork and playback history all become part of using it. Copying an audio folder preserves only some of that work. Sona organizes music and local MVs in a Windows and Android client, with local playback as the core path and cloud services as optional additions.
Connect the player to a durable local model
The project combines a Flutter and Dart interface, Riverpod state, SQLite storage and media_kit playback. This case focuses on the library workflow: inspecting imported files, preserving user edits and preparing data for recovery. Keeping those responsibilities explicit gives the visual player a stable record of what belongs in the collection.
Recognize files and keep edits reversible
Import inspection reads tags and computes a streamed SHA-256 digest in a Dart isolate. SQLite constrains both the path and content hash to be unique, so a renamed byte-identical file does not need a second library entry. This is file-level deduplication; different encodings of the same recording can still have different hashes.
Metadata changes save before-and-after values in the same database transaction as the edit. Undo first checks that the track still matches the recorded after-state. If another change has intervened, it declines to overwrite it. The user can inspect a correction without making history a route to silently losing newer work.
Give two kinds of backup different promises
A manual backup includes the database, referenced songs and MVs, and managed visual assets. An automatic snapshot keeps the database and artwork while leaving media files in place. That avoids repeatedly copying the entire collection, but ties automatic recovery to files still present on the same device. It cannot substitute for a complete export before moving devices or uninstalling.
The backup service reads file references from a consistent SQLite snapshot. Otherwise an import or deletion during export could make the packaged files disagree with the archived database. Missing referenced files stop creation rather than producing a package that appears complete.
Check recovery before replacing the library
Restore verifies checksums and archive paths, stages files, rewrites stored paths and checks database integrity before marking a restart as required. Cold-start application verifies the staged database again and retains a pre-restore database. The implementation includes a recovery path for an interrupted replacement, rather than treating extraction alone as completion.
Repository tests specify a round trip that preserves favorites, play counts, playlist membership and media bytes. Other cases reject corruption, missing media and archive traversal; a widget test edits a title and undoes it through history. These cases make the recovery contract inspectable, while real-device migration remains a separate acceptance step.
Keep the preview's limits visible
The public distribution is a preview for Windows and Android. Complete backups are unencrypted and omit account sessions and cloud credentials. Automatic snapshots depend on the original media and disappear with app-private data on uninstall. Large real libraries, device migrations and operating-system interruption behavior still need separate acceptance evidence; source code alone cannot establish those outcomes.