Skip to content

[Feature] Automatic Last.fm Backfill for plays on other devices #443

Description

@tsibog

Problem

YouTube Music has no native Last.fm integration. When listening on a phone (or any device other than the Mac running Kaset), those plays are never scrobbled, leaving gaps in your Last.fm listening history.

Kaset already scrobbles its own playback in real time. But plays on other devices, on the same YouTube Music account, go unrecorded even though YouTube Music already logs them in its account-wide play history. The backfill reads that existing history, so no additional data is shared with Google.

Proposed Feature

An "Automatic Backfill" option in the Last.fm settings that periodically checks the YouTube Music account's play history for tracks played on other devices and retroactively scrobbles them to Last.fm.

User story: I listen to YouTube Music on my phone during my commute. When I get home and open Kaset on my Mac, the backfill detects the plays from my phone and adds them to my Last.fm profile, so my listening history is complete.

Suggested approach

  • Trigger: Periodic timer while Kaset is open, paused while Kaset is actively playing (it's already scrobbling live then). Configurable interval, globally disableable.
  • Lookback: Fetch history since the last successful backfill timestamp. On first enable, set to current time (no massive historical import).
  • Dedup: Check Last.fm recent tracks and skip plays already scrobbled, regardless of which tool scrobbled them. This also catches Kaset's own live scrobbles that failed due to network hiccups, giving a free resilience boost.
  • Scope: All signed-in devices (phone, web, other Macs).
  • Filtering: Only scrobble music-tagged entries (skip podcasts, non-music videos). For skip detection, compare consecutive play timestamps as a best-effort heuristic: if the next play starts within less than half the current track's duration, assume a skip. This is imprecise (the history API doesn't include actual listen duration, only that a play occurred), but catches obvious cases.
  • Offline: Skip the cycle without advancing the timestamp. Next successful run picks up everything.
  • Visibility: Quiet. Status line in settings: "Last backfill: N tracks, X min ago". No notifications.

Edge cases

  • YT Music history paused: If watch history is disabled in YT Music settings, the history endpoint returns empty. Show a one-time warning in the backfill settings.
  • Mid-playback on another device: A track currently playing on the phone may not yet appear in history. The next cycle catches it once it lands.

UI placement

Below the existing "Enable Last.fm Scrobbling" toggle and account section, in the same Scrobbling pane:

  • "Automatic Backfill" toggle
  • Interval selector (default 15 min, configurable)
  • Status line: "Last backfill: N tracks, X min ago"
  • Warning banner (shown once if YT Music history is paused)

Non-goals

  • Full historical backfill (only plays after enabling).
  • Real-time scrobbling from other devices (periodic catch-up, not a live bridge).
  • Google Takeout import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions