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

Add an API endpoint to get a user's current pin

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None

      It's currently very cumbersome to get a user's current pin.

      First you have to get all pins (/$user_name/pins), then take the first item in the pinned_recordings array, then compare the current timestamp to the pinned_until timestmap in the pin.

      Instead, it would be much more convenient to have an endpoint such as /$user_name/pins/current that would return a single pin (the current pin) or an empty object.

      The context of this request is the Discourse ListenBrianz plugin that outsidecontext added. It's an example of why the complications of this API endpoint are preventing adoption of pins being displayed elsewhere:
      See https://community.metabrainz.org/t/showing-a-users-listenbrainz-listens-in-their-discourse-community-profile/621375/24

            kartik1712 amCap1712
            mr_monkey Monkey
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package