Les pièces jointes audio ne fonctionnent pas lorsque « empêcher les anonymes de télécharger des fichiers » est activé

Je ne sais pas si c’est un bug, mais je constate un comportement incohérent avec les fichiers audio uploadés.

Hier, j’ai activé le format MP3 pour les pièces jointes de notre forum et j’ai testé un glisser-déposer dans un message privé à moi-même. Cela a fonctionné comme prévu, avec un lecteur intégré s’affichant dans le message.

Cependant, je viens de réessayer et il affiche maintenant le lien de téléchargement. Je pense que j’ai fait la même chose qu’hier (glisser-déposer du fichier dans l’éditeur), mais les résultats sont différents.

D’après ce que je vois ici chez @techAPJ, il semble que le « lecteur natif » devrait être l’option par défaut pour les fichiers audio uploadés, n’est-ce pas ? — https://meta.discourse.org/t/playing-mp3-next-to-the-button-to-download-the-file/26944/29?u=bts

Au fait, lorsque j’édite le message et que je consulte le texte brut, voici ce qui génère le lecteur audio natif attendu, et ce que j’ai obtenu en ajoutant un fichier dans le MP de test que je m’étais envoyé hier :

https://forum.troygrady.com/uploads/default/original/2X/3/38d861bfed1a26b23255bbd634263ff63fba1371.mp3

Alors qu’en réessayant aujourd’hui, en répondant au MP précédent et en glissant un fichier MP3 à uploader, je vois que le suivant a été inséré à la place dans le message, affichant le lien de téléchargement plutôt que le lecteur intégré :

<a class="attachment" href="/uploads/default/original/2X/3/38d861bfed1a26b23255bbd634263ff63fba1371.mp3">Centipede - Backing Track.mp3</a> (2.3 MB)

Do you have the ‘prevent anons from downloading files’ Site Setting enabled? That setting will prevent an audio player from being created.

Ah okay interesting! Thanks — yes I have that setting enabled as I do think it makes sense to prevent anons from downloading files.

But doesn’t seem like that setting should require disabling the audio player for logged in users?

Actually it appears that viewing as an anon user, the native audio player (both playback + download) is disabled anyway even using the raw embed URL rather than wrapping in the <a class="attachment"> tag.

E.g. the last post here, when I’m logged in I can play back and download the one-minute audio file, but viewing as anon it just appears as a non-functional player (no playback or download link):

Short term I guess I can turn off prevent anons from downloading files since for now it’s more just a minor preventative measure and I think it’s more important for audio playback to work correctly.

Also might be kinda fine to just have the behavior in the post linked above (showing disabled player) rather than not show player at all, when that prevent anons from downloading files is on. Or long term maybe Discourse could add a built in (but still super simple) audio player overriding the browser default but allowing more control over display / download settings.

(Assuming no other changes, for now perhaps a tip in that setting would help; to me very unintuitive that a setting re: download permissions would affect the inline audio player!)