Downloader: clean a bit downloader::get_episode function.
This commit is contained in:
parent
c1ecdbda52
commit
ed5ff16598
@ -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> {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user