Skip to content

Fixed recursive fetch when new url is unchanged#10

Open
doeixd wants to merge 3 commits intojbierfeldt:masterfrom
doeixd:master
Open

Fixed recursive fetch when new url is unchanged#10
doeixd wants to merge 3 commits intojbierfeldt:masterfrom
doeixd:master

Conversation

@doeixd
Copy link
Copy Markdown

@doeixd doeixd commented Jul 17, 2020

As is, the script will infinitely fetch this podcast this pr will fix that

@amoran
Copy link
Copy Markdown

amoran commented Jul 28, 2020

Is this PR ready? I'm experiencing the same issue and would love to have the new version with fixes included!

Comment thread index.js Outdated

if (channel["itunes:new-feed-url"]) {
return await getPodcastFromURL(channel["itunes:new-feed-url"][0], params)
const newURL = channel["itunes:new-feed-url"][0]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no property "itunes:new-feed-url", accessing the 0th element will fail.

added null check
Copy link
Copy Markdown
Author

@doeixd doeixd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a null check

@micahjon
Copy link
Copy Markdown

Thanks @doeixd for working on this--I ran into this bug today and had to patch my local version.

It looks like the Travis CI build failed b/c of the optional chaining syntax (?.), which isn't supported until Node 14. I appreciate the fact that this project still works on supported versions of Node like 10 & 12.

If you remove that syntax, I bet it will be merged w/out issues. In fact, this PR could be a one liner, e.g.

if (channel["itunes:new-feed-url"] && channel["itunes:new-feed-url"][0] !== url) {

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants