From 7f8544373faca60c14d62c32a26d3a60594dd980 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 10 Jan 2018 02:14:49 +0200 Subject: [PATCH] EpisodesView: Show 50 episodes instead of 100. --- hammond-downloader/src/downloader.rs | 8 ++------ hammond-gtk/src/manager.rs | 3 ++- hammond-gtk/src/views/episodes.rs | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hammond-downloader/src/downloader.rs b/hammond-downloader/src/downloader.rs index ad29411..180e586 100644 --- a/hammond-downloader/src/downloader.rs +++ b/hammond-downloader/src/downloader.rs @@ -177,11 +177,7 @@ pub fn cache_image(pd: &PodcastCoverQuery) -> Option { return None; } - let cache_download_fold = format!( - "{}{}", - HAMMOND_CACHE.to_str().unwrap(), - pd.title().to_owned() - ); + let cache_download_fold = format!("{}{}", HAMMOND_CACHE.to_str()?, pd.title().to_owned()); // Weird glob magic. if let Ok(mut foo) = glob(&format!("{}/cover.*", cache_download_fold)) { @@ -196,7 +192,7 @@ pub fn cache_image(pd: &PodcastCoverQuery) -> Option { DirBuilder::new() .recursive(true) .create(&cache_download_fold) - .unwrap(); + .ok()?; match download_into(&cache_download_fold, "cover", &url, None) { Ok(path) => { diff --git a/hammond-gtk/src/manager.rs b/hammond-gtk/src/manager.rs index d482fbe..b6830d6 100644 --- a/hammond-gtk/src/manager.rs +++ b/hammond-gtk/src/manager.rs @@ -20,8 +20,9 @@ pub struct Progress { impl Progress { pub fn get_fraction(&self) -> f64 { - info!("Progress: {:?}", self); let ratio = self.downloaded_bytes as f64 / self.total_bytes as f64; + debug!("{:?}", self); + debug!("Ratio completed: {}", ratio); if ratio >= 1.0 { return 1.0; diff --git a/hammond-gtk/src/views/episodes.rs b/hammond-gtk/src/views/episodes.rs index 5bb44b9..dc36148 100644 --- a/hammond-gtk/src/views/episodes.rs +++ b/hammond-gtk/src/views/episodes.rs @@ -77,7 +77,7 @@ impl Default for EpisodesView { impl EpisodesView { pub fn new(sender: Sender) -> Arc { let view = EpisodesView::default(); - let episodes = dbqueries::get_episodes_widgets_with_limit(100).unwrap(); + let episodes = dbqueries::get_episodes_widgets_with_limit(50).unwrap(); let now_utc = Utc::now(); episodes.into_iter().for_each(|mut ep| {