docbrown/spec/services/podcasts
Daniel Uber 913ca720a8
Don't create podcast episodes without any media (#17449)
* Don't create podcast episodes without a media_url

There is an early return from add_media_url to prevent using an empty
enclosure_url, which avoids errors in
`GetMediaUrl.call(a_blank_value)`, however there's also a not null
constraint on podcast_episodes.media_url in the database, which causes
upsert to raise an error.

Returning early here avoids the error (which had halted the worker).

See also
https://app.honeybadger.io/projects/66984/faults/80833402

This error happens regularly, 96 times per day in DEV, it looks like at least
one podcast feed_url is for an rss feed filtered by /tag/podcast/,
(and at least one post was tagged "podcast" but didn't include any
media to get).

My understanding is at worst we'll ignore the error silently.

* Add test cases

given a blog post (not a podcast episode, no media url), don't raise
any error, don't create any episode.

Included codepunk.io feed that was showing this issue initially.
2022-04-27 11:21:03 -05:00
..
create_episode_spec.rb Don't create podcast episodes without any media (#17449) 2022-04-27 11:21:03 -05:00
episode_rss_item_spec.rb Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
feed_spec.rb Add Errno::EHOSTUNREACH to Podcasts's rescue list (#16884) 2022-03-15 14:05:04 -04:00
get_episode_spec.rb Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
get_media_url_spec.rb Spelling (#15702) 2021-12-07 06:59:10 -07:00
update_episode_media_url_spec.rb Update podcast episode statuses #2952 (#3450) 2019-07-16 13:36:25 -04:00