Something went wrong. Try again.
A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
Something went wrong. Try again.
123456789101112131415161718/** * Milliseconds left of a published now-playing status, or 0 once the track has * finished (or when its duration is unknown, where deferring would mean * guessing how long to wait). * * A websocket source that drops its connection fires song.stopped straight * away, which would otherwise clear a status for a track that is still * playing. Spotify polls instead of holding a socket, which is why it was the * only source this never affected. */export function remainingPlaybackMs( last: { startedAt: number; durationMs: number } | null | undefined, now: number,): number { if (!last?.durationMs) return 0; return Math.max(0, last.startedAt + last.durationMs - now);}