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

So cool!

I don’t know if I would necessarily need more. Maybe a button to the users profile next to the play button. Could go crazy with other stats but this seems nice and straightforward.
Edit: Maybe some text somewhere saying “last played:”

P.S. If there’s an easy way to do this for Discord and/or OBS Studio that would satisfy a sh*t ton of online requests/searches :smiley:

1 Like

I don’t know if I would necessarily need more.

Me neither. And actually I would not want to make this too complex in either way, more along of smaller suggestions like yours.

What I definitely wanted to have is a short profile view showing some basic data about the user profile as an alternative to the recent listen. This this currently looks like:

grafik

The time range to use for the data would be configurable. The bars in the background show the listening activity over this time frame.

P.S. If there’s an easy way to do this for Discord and/or OBS Studio that would satisfy a sh*t ton of online requests/searches :smiley:

No idea about those as I’m using neither actively. Maybe someone gets inspired to do something for these, but definitely not me. Outside my interests and enough on my plate already :slight_smile: And regarding Discord I don’t do open source work for closed source software out of principle, at least not unpayed :smiley: (and yes, there have been exceptions).

3 Likes

Ok friends of ListenBrainz, I did the changes I had in mind for a first working version.

The user can now choose between two different display options: Most recent listens and user profile statistics.

The most recent listens display is the default. It shows either the currently playing track or the most recent listened to track. If currently playing, a small notes icon is displayed. It will only show the most recent listen up to a specific age in hours, anything played earlier would not be displayed and hidden. The user can configure this. Example:

grafik

The user profile statistics show a few details for the user profile over a certain period of time (by default the last 30 days). It shows the total listen count, a cover collage of top releases, the most listened to track and a background bar chart of listening activity. Example:

grafik

The user can in their profile preferences choose between the time ranges last 7 days, last 30 days (default), last year and all time.

This is how the user preferences look like:

grafik

Not really sure about the options, but it seemed to work for me and give the users a bit of control what to display.

That’s it for now. I won’t do any further changes on this unless this plugin will actually get used. @zas what’s your take on this? EDIT: Just read the news about Freso’s absence for some time, so let’s not bother him.

3 Likes

This is sooo cool! Yes please to adding it @Zas!

2 Likes

We could add it of course (but that’s another plugin to maintain).
@reosarevok what do you think?

1 Like

Just wanted to write down some of my motivation to write this plugin (in addition to the technical interest, but this could have been satisfied with some other topic):

  • I consider ListenBrainz the currently most interesting MetaBrainz project with the most potential. I think it is something that is turning into a useful tool that makes digital music interesting. As such it can drive new users to contribute to the MusicBrainz database. In the age of CD ripping and file sharing taggers like Picard motivated users to contribute *), LB can take a similar role in the time of streaming music. Hence I consider it useful to cross-link it with the rest of the MetaBrainz world.

  • ListenBrainz is the most social MetaBrainz project, and the forums here are one of the important social platforms for the community (the other being IRC). Giving people the ability to cross-link can benefit the community.

  • We all here have different musical tastes. But I think what unites the MB community is a love for music, a certain obsession with organizing and documenting music metadata, and in many cases a quite broad and open minded taste for music. I’m sure the primary topics of discussion here will stay around the technicality of MB metadata and tagging, but I also welcome all discussions that are more about the music, like the recent MusicBrainz Album Club initiative. Bringing projects like CritiqueBrainz and ListenBrainz closer to the community can help making this part of the community more active.

That’s just my motivation. In the end I understand of course concerns about maintaining the Discourse setup, and if it’s chosen to not install this plugin I’m absolutely fine with that. But personally I’d love to see this functionality added and I’m definitely willing to maintain this plugin and tackle any issues that might come with new Discourse releases, just as I do with the MB onebox plugin. Discourse is rather stable here so I don’t expect much work. And if there is too much trouble this plugin can be turned off (temporarily or forever) without a big impact on the forums as a whole.


*) And still does, of course. Don’t worry here, I’ll keep using and developing for Picard

6 Likes

I’m fine with adding this, and just removing it again if it gets unmaintained and starts causing issues. Is there a way for users to opt out if they do not want to share their listening with the forum so directly?

2 Likes

They need to opt-in, see the settings screenshot above.

3 Likes

Then it seems perfectly fine to me :slight_smile:

3 Likes

@zas Shall we move forward with this then? I’ve been testing the plugin locally now for a while with different browsers, different themes and different states on LB and things are working as I intended. So from my side this is all good for a production deployment.

1 Like

I installed the plugin, so users can now go to their Preferences to enable it if they want.

1 Like

And found a bug when users have a non-English locale configured in Discourse :frowning: Sorry for that. I’m getting this fixed ASAP.

2 Likes

@Zas I updated the plugin. There was an exception thrown when users opened their profile preferences if they had set their Discourse language to anything else but English. This is now fixed. Sorry for the trouble.

Also, could you tick the option " listenbrainz username matches discourse" in Discourse Admin > Plug-ins > listenbrainz? That will make the username default to the Discourse username, so users in most cases don’t have to enter the name again. I added this specifically for the use case here in the forums.

2 Likes

Upgrade done, and option enabled.

2 Likes

Thanks a lot, that worked :slight_smile: I’ll do a separate post about this feature tomorrow to explain it to users and give it some place to discuss it from the users perspective.

2 Likes

Thank you so much @outsidecontext !
I missed this thread and just discovered the new feature yesterday and was truly surprised!
I love the feature, I think it’s a great fit for this specific forum, and I love the symbol it represents of more integrations to come between LB and other social websites people use.

It takes me way back to automated bulletin board signatures :slight_smile:

The one thing I could think of as an improvement would be showing when the listen was listened to.
Following the design on LB you could add that date string on the right hand side.

Quick mockup:

And for what it’s worth, if it’s of any use, here’s the function we use to display the listen time in LB:

4 Likes

@mr_monkey Good suggestion. I added this to my development branch. Needs a bit more testing. For the display I can use the function provided by Discourse. It has pretty similar functionality to the LB code for displaying the time ago, so it should give mostly the same result, and it will be consistent how Discourse displays those relative dates elsewhere.

1 Like

FYI, the profile statistics view has a very low contrast in dark mode (even lower than in light mode) which makes the bars hardly visible:


Is this intended or did you just not test the extension in dark mode?

Rather low contrast here is intentional, as the background is supposed to have a high contrast against the foreground so the text stays readable. On my monitors the bars are rather good visible.

The colors also come from the theme, so it’s expected that it varies. That also means I need to find some balance that works across themes.

I could choose the next brighter color, but I find it harms the readability of the foreground text. Below is how the brighter color would work across all of the Discourse default themes:

In comparison this is the current color setting (which I prefer):

3 Likes

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

2 Likes