Showing a user's ListenBrainz listens in their Discourse community profile

Found another color setting that might work. Is the below better visible to you?

2 Likes

Yeah, that one is better.
Seeing the comparison between all these themes in the previous post, I’m clearly using the one for which your extension has the worst contrast :sweat_smile:

1 Like

Yes. Unfortunately it is the dark variant of the default theme :smiley: The other ones are also themes Discourse does include by default, but they are not available here in the MB forums. But I do test with them on my local dev setup.

But the new color variable I chose looks better in all those variants, so I’ll use this now. Thanks for the feedback!

I thought of another potentially useful feature (I hope we’re not entering feature creep, and in any case feel free to ignore the suggestion of course): showing the user’s currently pinned listen if there is one, with a fallback to one of the other modes.

At this point it will become hard to phrase in the preferences dropdown: “Current pin with fallback to most recent listen or user profile statistics”…

I suppose the length of the accompanying text (if any) could become an issue:
image

As for the API side, there’s currently no great way to get the currently pinned listen : you need to get all pins for a user (https://api.listenbrainz.org/1/mr_monkey/pins), then compare the pinned_until timestamp of the first item in pinned_recordings to the current timestamp to determine if it is still pinned.

I’m happy to implement a better endpoint that will return only the current pin for a user, it seems to me that it would be a lot less cumbersome for such a case.

2 Likes

Indeed I had thought about doing something with the pins, but because of the API I decided against it. I’m happy to implement something in the plugin if there is a proper API that can give me the pins :slight_smile: Ideally something that I can limit to a single result of a pinned recording.

I’m sure I can come up with some way to better represent this in the settings.

I’ll likely restrict it in some way or make it expandable.

2 Likes

Yep, that all makes sense. I’ve created LB-1232 to track this.

2 Likes

And @lucifer swooped in and fixed that!

You can now directly get a user’s current pin: https://api.listenbrainz.org/1/outsidecontext/pins/current

If there is none, pinned_recording will be null

2 Likes

Thanks @lucifer . I’ll see how I can make use of it for displaying the pinned recordings. ~phw/discourse-listenbrainz#7: Pinned recording info card — sourcehut todo

I’ll need some time until I get to this, though.

1 Like

I implemented showing the current pin:

grafik

grafik

For the preferences I decided to make this an extra option for the recent listen card. It shows the current pin or if there is none falls back to the listen.

This will be available here once discourse and the plugin get updated. @zas :slight_smile:

3 Likes

ListenBrainz plugin upgrade applied (0.13.1).

2 Likes

0.13.2 was deployed.

2 Likes