Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-1109

API needs a way to delete a listen that has the same (timestamp, recording_msid) as another listen

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • API
    • None

      As noted in https://listenbrainz.readthedocs.io/en/latest/developers/architecture.html?highlight=unique#listen-flow listens are unique by the (user, timestamp, track_name) tuple.  But the delete_listen endpoint takes (user, timestamp, recording_msid) as input https://listenbrainz.readthedocs.io/en/latest/users/api/core.html#post--1-delete-listen .

      So currently there is no way to delete a specific listen if there are multiple listens at the same timestamp with the same recording_msid and different track_names.

      For example, I have the following listens and want to delete the latter.

          {
            "track_metadata": {
              "artist_name": "Hannah Gill",
              "release_name": "Songs From Quarantine",
              "additional_info": {
                "origin_url": "https:\/\/hannahgillmusic.bandcamp.com\/album\/songs-from-quarantine",
                "artist_msid": "3cd7dac3-a6a1-43c3-b06c-465082f720b4",
                "release_msid": "1b334a5f-3831-4ea2-8d78-f16ec4f06db5",
                "recording_msid": "3fb8569d-5550-4d70-815b-2b42cc8528ca"
              },
              "track_name": "Thinking Of You",
              "mbid_mapping": {
                "recording_mbid": "1ecf4d5b-1974-4fff-9df4-bb820ad9c59b",
                "release_mbid": "94f44fab-499a-4bce-a5e2-86f6f6125cc4",
                "artist_mbids": [
                  "3f14451a-387d-4f85-baf1-f2c75d9c0610"
                ]
              }
            },
            "listened_at": 1655090839,
            "recording_msid": "3fb8569d-5550-4d70-815b-2b42cc8528ca",
            "user_name": "avh4",
            "inserted_at": 1655090930
          },
          {
            "track_metadata": {
              "artist_name": "Hannah Gill",
              "release_name": "Songs From Quarantine",
              "additional_info": {
                "artist_msid": "3cd7dac3-a6a1-43c3-b06c-465082f720b4",
                "release_msid": "1b334a5f-3831-4ea2-8d78-f16ec4f06db5",
                "listening_from": "lastfm",
                "recording_msid": "3fb8569d-5550-4d70-815b-2b42cc8528ca",
                "lastfm_track_mbid": "eeb379f2-21d2-485d-b8ae-d08b25a15e84",
                "lastfm_artist_mbid": "3f14451a-387d-4f85-baf1-f2c75d9c0610",
                "lastfm_release_mbid": "94f44fab-499a-4bce-a5e2-86f6f6125cc4"
              },
              "track_name": "Thinking of You",
              "mbid_mapping": {
                "recording_mbid": "1ecf4d5b-1974-4fff-9df4-bb820ad9c59b",
                "release_mbid": "94f44fab-499a-4bce-a5e2-86f6f6125cc4",
                "artist_mbids": [
                  "3f14451a-387d-4f85-baf1-f2c75d9c0610"
                ]
              }
            },
            "listened_at": 1655090839,
            "recording_msid": "3fb8569d-5550-4d70-815b-2b42cc8528ca",
            "user_name": "avh4",
            "inserted_at": 1655146655
          }, 

      or preferably for my use case, it would be better if listens were deduped based on (user, timestamp, recording_msid) instead of on (user, timestamp, track_name).

            kartik1712 amCap1712
            avh4 Aaron VonderHaar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package