Show LB placeholder in case of image loading errors

Tags: #<Tag:0x00007f31bb0e4fe0>

I was thinking of closing down my Last.fm account recently and so I was browsing ListenBrainz.org to… I don’t known, have a look.

I noticed cover arts on releases have loading errors on my PC (never mind this, it’s probably my company’s zScaler/proxy/firewall/anything).

In the case of loading errors, the browser will not display nicely:


User "jesus2099" - ListenBrainz
ia801209.us.archive.org/31/items/mbid-36c7dddc-847b-4a3e-81ed-4d2b09b124f4/mbid-36c7dddc-847b-4a3e-81ed-4d2b09b124f4-18122118302_thumb250.jpg:1 Failed to load resource: net::ERR_EMPTY_RESPONSE

I also have those, but I guess it’s no issue, it’s normal when a release has no cover arts and in this case the placeholder is shown:

coverartarchive.org/release/ea69af2e-d608-490e-9f76-766a3eba6d40:1 Failed to load resource: the server responded with a status of 404 (NOT FOUND)

I think it should display the ListenBrainz placeholder in case of error event.

Another oddity is that in this case, the alt text was Cover Ar instead of the actual release title:

永遠の歌声 VOL.1 オリジナル曲のすべて
<img src="http://coverartarchive.org/release/36c7dddc-847b-4a3e-81ed-4d2b09b124f4/18122118302-250.jpg" alt="Cover art">

Although other loading error images do have a proper alt text:

image
<img src="http://coverartarchive.org/release/6eb26f28-77f5-4b5e-bebc-673efd4b3603/20760367483-250.jpg" alt="Hour of the Nightingale">

And it doesn’t seem related to non-Latin characters as there are some showing in this other case:

image
<img src="http://coverartarchive.org/release/87bd276d-cd12-43d2-baf8-53e07ec4de4b/18763809714-250.jpg" alt="ライブ収録盤">

Long release title, will also lead to worse display:

image

1 Like