Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert podcast description to text #349

Closed
brian-doherty opened this issue Aug 13, 2023 · 15 comments
Closed

Convert podcast description to text #349

brian-doherty opened this issue Aug 13, 2023 · 15 comments

Comments

@brian-doherty
Copy link
Contributor

The Subsonic players I've used for podcasts (DSub, Airsonic) don't handle HTML in the podcast description well and so it doesn't render properly. Purpose instead to convert to text.

@sentriz
Copy link
Owner

sentriz commented Aug 13, 2023

i think something like bluemonday could be a good fit for that
image

@archekb
Copy link
Contributor

archekb commented Aug 14, 2023

I was add cleaner from html tags to Airsonic-refix (tamland/airsonic-refix#110) I don't know when owner will merge this commit, but you can take my version with latest commits https://github.com/archekb/airsonic-refix

@brian-doherty
Copy link
Contributor Author

brian-doherty commented Aug 14, 2023 via email

@archekb
Copy link
Contributor

archekb commented Aug 14, 2023

it would be way cooler if the client would either strip or (preferably) render the HTML

No problem, I'll add this feature when will make Airsonic-refix client settings. It can be turned on or off by your chose on the settings.

Preview current:
image

with html render
image

With html render it's a little bit more pretty, then we should stay tags in the description on the server.

@brian-doherty
Copy link
Contributor Author

Yeah, the issue is that other clients don't render the HTML either. I'm asking whether we should just strip at the server because of that. For example, DSub.

@archekb
Copy link
Contributor

archekb commented Aug 14, 2023

I suppose it's not server issue (because server get description from podcast and sent it to client as raw), this is client issue, maybe you need to open issue for client?

Because after your comment I'll add support html tags to Airsonic-refix, because this is a little more pretty, for me. ;)

@brian-doherty
Copy link
Contributor Author

So I checked and while the Subsonic API definition is ambiguous on this, the actual Subsonic implementation converts HTML to text on the way into the database. The magic question is -- do we keep the HTML and give clients the opportunity to go above and beyond, or do we match so that clients used to the way that Subsonic does things render correctly?

@sentriz
Copy link
Owner

sentriz commented Aug 14, 2023

i think keep it simple for now - if we sanitise the html on the way out of the db and into the rest view, we keep all clients happy, while still keeping the data intact if any clients decide to support it later

@brian-doherty
Copy link
Contributor Author

Screenshot_20230814_143323_DSub

So, bluemonday does OK but doesn't add carriage returns for paragraph breaks. See attached photo. I wonder if https://github.com/k3a/html2text or https://github.com/jaytaylor/html2text would be better.

@brian-doherty
Copy link
Contributor Author

Screenshot_20230814_144957_DSub
I used jaytaylor/html2text because it was more popular and I think it's way better. I'll send that in as a PR for you to see what you think.

@archekb
Copy link
Contributor

archekb commented Aug 14, 2023

Maybe we can makes it optional? Description without tags looks boring. (after adding rendering xD) Something like GONIC_PODCAST_RAW_DESCRIPTION

PS Maybe we will Sanitaize and podcast description, not only Episodes description?

@betapictoris
Copy link
Contributor

Maybe we can makes it optional? Description without tags looks boring. (after adding rendering xD) Something like GONIC_PODCAST_RAW_DESCRIPTION

PS Maybe we will Sanitaize and podcast description, not only Episodes description?

What about adding it as an option depending on the client parameter, similar to transcoding profiles? That way it'd be possible to use it for clients that support it, all, or none.

@brian-doherty
Copy link
Contributor Author

brian-doherty commented Aug 15, 2023 via email

@sentriz
Copy link
Owner

sentriz commented Aug 15, 2023

oh, i just noticed we can close this one. we can chat about the option over on #352 i suppose. thanks!

@sentriz sentriz closed this as completed Aug 15, 2023
@betapictoris
Copy link
Contributor

Making it a config parameter AND adding sanitization to the podcast description are OK by me if they're OK by Senan. I don't think we should add to the Subsonic API but if we did it would be a parameter to getPodcasts and getNewestPodcasts.

I was thinking more of an option in the admin page like transcoding profiles but for podcast description sanitization, kinda like this:

Frame 1

I don't think doing it this way would require moving away from the Subsonic API....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants