When a submit fails for a transient reason (no connection, bad gateway,
server error, rate limit) the scrobble is saved to a Room table and a
network-constrained WorkManager job sends it later, in batches of 50,
oldest first. Plays too old for the server are dropped, and a rejected
session or unexpected error leaves the queue untouched. Safe to retry as
the server dedupes on (user, played_at, artist, track).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Search results pre-fill the manual form (artist, track, album, MBID and
duration) so they can be corrected before scrobbling. Editing the artist
or track drops the MBID/duration since they describe a specific recording.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Free-text queries become escaped Lucene (every word must match title,
artist or release), requests are spaced at 1/s with an app-identifying
User-Agent, and results are mapped to artist/track/album/duration/mbid
with same-song duplicates collapsed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Artist/track/album form with a "played" time chip (now to yesterday) that
submits through ScrobbleRepository. On success the form clears but keeps
the time choice, and History reloads when revisited so the new play shows.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
TrackDraft is the editable track shared by all add paths, validated
against the server's 14-day / 5-minute window. ScrobbleRepository submits
via track.scrobble with the stored session key, treating an "ignored"
result or an invalid session as errors.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Home shows a now-playing panel (polled every 15s while visible), summary
stats and the latest scrobbles. History is an infinite-scrolling,
pull-to-refresh list that dedupes rows when pages shift. Adds edge-to-edge
system bars, themed nav bar and a Sign out button.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ScrobblerApi gains /me/now-playing, /me/recent and /me/summary with
null-safe parsing; HistoryRepository reads with the stored bearer token
and maps a 401 to SessionExpiredException.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DefaultAuthRepository logs in for a bearer token, finds or creates the
"Scrobbled Android" API app (reused on reconnect), then obtains a Last.fm
session key via auth.getMobileSession. Credentials are encrypted with an
Android Keystore AES-GCM key. Adds ScrobblerApi (/api/v1), a Connect
screen + ViewModel, and gates the main shell on stored credentials.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signer matches the server's md5 scheme (verified against vectors generated
by its Python implementation, including unicode). LastFmClient supports
auth.getMobileSession, track.scrobble (batched, indexed fields) and
track.updateNowPlaying, mapping server errors to LastFmException.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Kotlin + Compose via AGP built-in Kotlin, Material 3 theme mirroring the
web UI palette, bottom-nav shell with placeholder screens, cleartext
network config for self-hosted servers, and a CI workflow running unit
tests, lint and a debug build.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>