Method: Epodder::Download#look_for_episodes
- Defined in:
- lib/verb/download.rb
#look_for_episodes(podcast) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/verb/download.rb', line 11 def look_for_episodes(podcast) episodes = Episode.all(downloaded: false, podcast: podcast) episodes.select { |ep| !ep.nil? }.each do |episode| puts episode.podcast.title title = (episode.podcast.title).strip Dir.mkdir "download/#{title}" unless Dir.exists? "download/#{title}" puts "Downloading #{title} - #{episode.title || episode.id}" download_episode episode end end |