Commit d00260b5 authored by Ozbolt Menegatti's avatar Ozbolt Menegatti

switched transcode/download check order and now removing audio_temp folder.

parent e6a8f822
......@@ -512,15 +512,14 @@ fn main() {
let small_channel = SmallChannel::from_rss(&channel, conf.clone());
for item in &small_channel.items {
if !item.is_downloaded() {
info!("Downloading: {}", item.title);
item.download_file();
} else {
info!("Already downloaded: {}", item.title);
}
if !item.is_transcoded() {
info!("Transcoding: {}", item.title);
if !item.is_downloaded() {
info!("Downloading {} -> {}", item.title, item.temporary_file());
item.download_file();
} else {
info!("Already downloaded: {} -> {}", item.title, item.temporary_file());
}
info!("Transcoding: {} -> {}", item.title, item.transcoded_file());
item.transcode().unwrap();
} else {
info!("Already transcoded: {}", item.title);
......@@ -539,6 +538,9 @@ fn main() {
clean_unused_audio_files(&used_audio_files).unwrap();
run_command(&format!("rm -r {}", TEMPORARY_AUDIO_FOLDER)).expect("Can not remove temporary audio files");
run_command(&format!("mkdir {}", TEMPORARY_AUDIO_FOLDER)).expect("Can not recreate folder for temporary audio files");
let mut file = fs::File::create("podcasts.json").expect("Could not podcasts.json");
file.write_all(podcasts.as_bytes()).unwrap();
file.write_all("]".as_bytes()).unwrap();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment