Downloader: clean a bit downloader::get_episode function.

This commit is contained in:
Jordan Petridis 2018-02-06 02:00:32 +02:00
parent c1ecdbda52
commit ed5ff16598
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -172,14 +172,13 @@ pub fn get_episode(
ep.save()?; ep.save()?;
}; };
let res = download_into( let path = download_into(
download_folder, download_folder,
&ep.rowid().to_string(), &ep.rowid().to_string(),
ep.uri().unwrap(), ep.uri().unwrap(),
progress, progress,
); )?;
if let Ok(path) = res {
// If download succedes set episode local_uri to dlpath. // If download succedes set episode local_uri to dlpath.
ep.set_local_uri(Some(&path)); ep.set_local_uri(Some(&path));
@ -191,10 +190,6 @@ pub fn get_episode(
ep.save()?; ep.save()?;
Ok(()) Ok(())
} else {
error!("Something whent wrong while downloading.");
Err(res.unwrap_err())
}
} }
pub fn cache_image(pd: &PodcastCoverQuery) -> Option<String> { pub fn cache_image(pd: &PodcastCoverQuery) -> Option<String> {