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

[Enhancement]: Handle Podcast RSS feed that isn't using CDATA for description fields #3778

Closed
kucksdorfs opened this issue Jan 2, 2025 · 6 comments
Labels
enhancement New feature or request

Comments

@kucksdorfs
Copy link

What happened?

I attempted to add an RSS feed (https://gorkyr.github.io/We-Want-MoR-Playlist/we-want-mor.rss) to my podcasts library, but ran into an error (log is pasted below)

What did you expect to happen?

Successfully add a podcast

Steps to reproduce the issue

  1. Log in with user who can create/add podcasts
  2. Add the feed "https://gorkyr.github.io/We-Want-MoR-Playlist/we-want-mor.rss"
  3. Error adding, navigated to Logs section under Settings and found a stack trace saying rawDescription.trim is not a function, rawDescription is probably null at this place.

Audiobookshelf version

v2.17.7 and v2.17.6

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Firefox

Logs

2025-01-02 17:42:48.904

ERROR

[podcastUtils] getPodcastFeed Error TypeError: rawDescription.trim is not a function at extractEpisodeData (/server/utils/podcastUtils.js:107:74) at /server/utils/podcastUtils.js:168:23 at Array.forEach (<anonymous>) at extractPodcastEpisodes (/server/utils/podcastUtils.js:167:9) at cleanPodcastJson (/server/utils/podcastUtils.js:190:24) at module.exports.parsePodcastRssFeedXml (/server/utils/podcastUtils.js:205:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /server/utils/podcastUtils.js:265:23

Additional Notes

No response

@kucksdorfs kucksdorfs added the bug Something isn't working label Jan 2, 2025
@nichwall
Copy link
Contributor

nichwall commented Jan 7, 2025

Looks like it specifically due to one of the episode descriptions being parsed as an object instead of a string. From that RSS feed:
<description><em>&#8230;blood spills out in litres, and someone screams a word.</em></description>
is parsed as an object
Description has type object: {"em":["…blood spills out in litres, and someone screams a word."]}

@advplyr
Copy link
Owner

advplyr commented Jan 7, 2025

Yeah I think it is invalid XML but I'm not an XML expert.

When using HTML tags it should be wrapped in CDATA

image

@kucksdorfs
Copy link
Author

For what it's worth, it looks like valid xml to me (I am a .net dev in my dat job that deals with too much xml). I am not super familiar with the js/node/vue environment, but is there any schema that backs deserializing an rss feed? If there was some kind of xsd that this can run against, then this whole thing shouldn't be an issue.

That said if this was a perfect world I would agree that this is on the publisher to fix.

@nichwall
Copy link
Contributor

nichwall commented Jan 8, 2025

Could probably just do something silly and say "if an object, strinigify" for descriptions and titles. It would render weird, but then it could at least be imported. We would probably then get bug reports about that, though...

@kucksdorfs
Copy link
Author

Could probably just do something silly and say "if an object, strinigify" for descriptions and titles. It would render weird, but then it could at least be imported. We would probably then get bug reports about that, though...

That gets my vote. Can probably even pit some kind of warning on the podcast page that says there may be iasues with the title/description if you do need to call stringify.

@advplyr advplyr added enhancement New feature or request awaiting release Issue is resolved and will be in the next release and removed bug Something isn't working labels Jan 10, 2025
@advplyr advplyr changed the title [Bug]: Error adding podcast from specific RSS feed - Feed provided [Enhancement]: Handle Podcast RSS feed that isn't using CDATA for description fields Jan 10, 2025
Copy link

Fixed in v2.18.0.

@github-actions github-actions bot removed the awaiting release Issue is resolved and will be in the next release label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants