Duplicated listens from Last.fm import

I’m scrobbling to both Last.fm and ListenBrainz from Musicbee. I occasionally do manual scrobbles to Last.fm and importing to Listenbrainz creates a bunch of duplicates in my feed.

Here’s a an example imported scrobble:

{
  "inserted_at": 1725337321,
  "listened_at": 1724991494,
  "recording_msid": "11436909-7c43-4e4a-985e-1ca945b9987f",
  "track_metadata": {
    "additional_info": {
      "lastfm_release_mbid": "5c1c0b6f-c066-4424-96a0-ddda317d18e3",
      "lastfm_track_mbid": "a98f41be-aab6-3291-8eb1-2d3e208e0611",
      "recording_msid": "11436909-7c43-4e4a-985e-1ca945b9987f",
      "submission_client": "ListenBrainz lastfm importer"
    },
    "artist_name": "The Arusha Accord",
    "mbid_mapping": {
      "artist_mbids": [
        "d8809528-3457-4c95-a573-783529cfcefb"
      ],
      "artists": [
        {
          "artist_credit_name": "The Arusha Accord",
          "artist_mbid": "d8809528-3457-4c95-a573-783529cfcefb",
          "join_phrase": ""
        }
      ],
      "caa_id": 29211865902,
      "caa_release_mbid": "5c1c0b6f-c066-4424-96a0-ddda317d18e3",
      "recording_mbid": "af131976-b414-497c-84a9-ac7269603c7f",
      "recording_name": "Dead to Me",
      "release_mbid": "5c1c0b6f-c066-4424-96a0-ddda317d18e3"
    },
    "release_name": "The Echo Verses",
    "track_name": "Dead To Me"
  },
  "user_name": "TurbinoZ100000"
}

And this is a directly sent listen by the ScrobbleBrainz plugin from Musicbee:

{
  "inserted_at": 1724991493,
  "listened_at": 1724991493,
  "recording_msid": "11436909-7c43-4e4a-985e-1ca945b9987f",
  "track_metadata": {
    "additional_info": {
      "duration_ms": 204373,
      "media_player": "MusicBee",
      "recording_msid": "11436909-7c43-4e4a-985e-1ca945b9987f",
      "submission_client": "ScrobblerBrainz",
      "trackNumber": "1"
    },
    "artist_name": "The Arusha Accord",
    "mbid_mapping": {
      "artist_mbids": [
        "d8809528-3457-4c95-a573-783529cfcefb"
      ],
      "artists": [
        {
          "artist_credit_name": "The Arusha Accord",
          "artist_mbid": "d8809528-3457-4c95-a573-783529cfcefb",
          "join_phrase": ""
        }
      ],
      "caa_id": 29211865902,
      "caa_release_mbid": "5c1c0b6f-c066-4424-96a0-ddda317d18e3",
      "recording_mbid": "af131976-b414-497c-84a9-ac7269603c7f",
      "recording_name": "Dead to Me",
      "release_mbid": "5c1c0b6f-c066-4424-96a0-ddda317d18e3"
    },
    "release_name": "The Echo Verses",
    "track_name": "Dead to Me"
  },
  "user_name": "TurbinoZ100000"
}

I can see the difference of one second with the listened_at parameter between the scrobbles. I don’t know how the importer checks for duplicates, is that enough to not create a match?

Correct – the timestamps must match to the second (anything smaller than a second is ignored) otherwise it creates a duplicate.

We know that this is not ideal, but making this duplicate detection process better is rather tricky – what solves one problem can create problems elsewhere. :confused:

2 Likes

I was afraid so. MusicBee has separate plugins for each client so seems the Listenbrainz scrobbler is just faster most of the time. Oh well, I will have to make manual additions to both I guess.