Last.fm scrobbling keeps a permanent, public record of every song you listen to, building up a rich listening history that powers personalised recommendations, year-in-review stats, and music discovery on the Last.fm platform. VIVI Music has a built-in Last.fm module that authenticates with your account and submits scrobbles and Now Playing signals in the background without any third-party apps or plugins.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vivizzz007/vivi-music/llms.txt
Use this file to discover all available pages before exploring further.
Connecting your Last.fm account
Open Integrations settings
In VIVI Music, tap the profile icon or navigate to Settings → Integrations → Last.fm.
Log in
Tap Login in the Account section. A dialog will appear asking for your Last.fm username and password.
Authenticate
VIVI calls Last.fm’s
auth.getMobileSession API with your credentials. On success, the session key and username are stored locally. The Account row will update to show your Last.fm username.VIVI Music loads its Last.fm API credentials from build-time secrets (GitHub Secrets / BuildConfig). The key is not hard-coded in the source; it is injected at compile time. You do not need to register a Last.fm developer application or supply your own key — authentication works straight out of the box in official builds.
What gets scrobbled
Every time a track passes the scrobble threshold VIVI submits the following fields to Last.fm’strack.scrobble endpoint:
| Field | Source |
|---|---|
track | Song title from the current queue item |
artist | Primary artist name |
album | Album name (when available) |
timestamp | Unix epoch at the point the scrobble fires |
duration | Track length in seconds |
trackNumber | Track position within the album (when available) |
track.updateNowPlaying so your Last.fm profile shows a live “Now Scrobbling” status — provided Now Playing is turned on in settings.
Scrobbling configuration
Minimum track duration
Tracks shorter than this threshold are never scrobbled. Adjustable from 10 s to 60 s (default: 30 s).
Scrobble delay (percent)
The fraction of a track that must play before a scrobble is submitted. Ranges from 30 % to 95 % (default: 50 %).
Scrobble delay (seconds)
A hard upper-bound cap: if a track is very long, the scrobble fires after this many seconds regardless of the percentage. Adjustable from 30 s to 360 s (default: 180 s).
How the Last.fm module works
Thelastfm/ Gradle module houses the entire integration in a single LastFM Kotlin object. It uses Ktor with an OkHttp engine and communicates exclusively with https://ws.audioscrobbler.com/2.0/. Every outgoing request is signed with an MD5 API signature computed from the sorted parameter map plus the bundled secret, matching the Last.fm API specification exactly. The session key returned at login is held in LastFM.sessionKey for the lifetime of the app process and persisted to DataStore via LastFMSessionKey.
Supported Last.fm API methods
Supported Last.fm API methods
| Method | Used for |
|---|---|
auth.getMobileSession | Username/password login |
auth.getToken / auth.getSession | Legacy OAuth flow (kept for compatibility) |
track.updateNowPlaying | Live Now Playing status |
track.scrobble | Submitting completed plays |
track.love / track.unlove | Syncing VIVI likes to Last.fm |
Sending likes to Last.fm
When Send Likes is enabled, liking a track inside VIVI callstrack.love and unliking it calls track.unlove. This lets your Last.fm loved-tracks list stay in sync with your VIVI library automatically.
Disconnecting Last.fm
To unlink your account, tap Logout in the Account section of the Last.fm settings screen. This clears bothLastFMSessionKey and LastFMUsernameKey from local storage and stops all future scrobbles immediately. No data is deleted from Last.fm itself.