Skip to main content

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.

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.

Connecting your Last.fm account

1

Open Integrations settings

In VIVI Music, tap the profile icon or navigate to Settings → Integrations → Last.fm.
2

Log in

Tap Login in the Account section. A dialog will appear asking for your Last.fm username and password.
3

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.
4

Enable scrobbling

In the Options section, toggle Enable Scrobbling on. You can also enable Now Playing (sends a live signal while a track is playing) and Send Likes (mirrors your VIVI likes to Last.fm).
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’s track.scrobble endpoint:
FieldSource
trackSong title from the current queue item
artistPrimary artist name
albumAlbum name (when available)
timestampUnix epoch at the point the scrobble fires
durationTrack length in seconds
trackNumberTrack position within the album (when available)
While a track is actively playing, VIVI also calls 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).
All three values can be reset to their defaults from within each dialog.

How the Last.fm module works

The lastfm/ 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.
MethodUsed for
auth.getMobileSessionUsername/password login
auth.getToken / auth.getSessionLegacy OAuth flow (kept for compatibility)
track.updateNowPlayingLive Now Playing status
track.scrobbleSubmitting completed plays
track.love / track.unloveSyncing VIVI likes to Last.fm

Sending likes to Last.fm

When Send Likes is enabled, liking a track inside VIVI calls track.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 both LastFMSessionKey and LastFMUsernameKey from local storage and stops all future scrobbles immediately. No data is deleted from Last.fm itself.
After connecting, head to last.fm/user/<your-username>/recent-tracks to confirm your first scrobbles are appearing. It usually takes just a few seconds for them to show up after a track passes the scrobble threshold.

Build docs developers (and LLMs) love