nog mooier

This commit is contained in:
Ward Wouts 2006-02-17 13:36:07 +00:00
parent 934463244f
commit 063394d20f

View file

@ -53,7 +53,7 @@ def deleteold(podcast)
Dir.open(@podcasts[podcast]["savedir"]).each {|entry| Dir.open(@podcasts[podcast]["savedir"]).each {|entry|
if File.file?("#{@podcasts[podcast]["savedir"]}/#{entry}") && if File.file?("#{@podcasts[podcast]["savedir"]}/#{entry}") &&
! @filelist[entry] ! @filelist[entry]
puts " deleting #{entry}" puts " deleting #{entry}"
File.unlink("#{@podcasts[podcast]["savedir"]}/#{entry}") File.unlink("#{@podcasts[podcast]["savedir"]}/#{entry}")
end end
} }
@ -69,7 +69,7 @@ def getenclosure(podcast, enclosure)
end end
@filelist[filename] = true @filelist[filename] = true
if ! File.exists?("#{@podcasts[podcast]["savedir"]}/#{filename}") if ! File.exists?("#{@podcasts[podcast]["savedir"]}/#{filename}")
puts " getting #{@podcasts[podcast]["savedir"]}/#{filename}" puts " getting #{@podcasts[podcast]["savedir"]}/#{filename}"
response = fetch(cast) response = fetch(cast)
File.open("#{@podcasts[podcast]["savedir"]}/#{filename}", "w"){|f| File.open("#{@podcasts[podcast]["savedir"]}/#{filename}", "w"){|f|
f.print(response.body) f.print(response.body)