PRX / feeder.prx.org

Dovetail podcast content management system
https://podcasts.dovetail.prx.org
GNU Affero General Public License v3.0
5 stars 0 forks source link

Release episodes for multiple feeds #963

Closed cavis closed 6 months ago

cavis commented 6 months ago

Closes #955.

Currently, our release_episodes logic does a comparison of episode published_at vs created_at, to determine what needs to be released on the 5-minute background cron.

This is maybe a bit brittle? And doesn't work when you consider multiple feeds being published with different episode offsets.

So instead - this uses some SQL to figure out all the timestamps every episode should publish at (joining episodes to feeds.episode_offset_seconds). And figures out the latest publishing_queue_item.created_at we've kicked off for that podcast_id. If we don't have a publishing queue >= the timestamp the episode drops ... create one!