EpisodesView: Show 50 episodes instead of 100.

This commit is contained in:
Jordan Petridis 2018-01-10 02:14:49 +02:00
parent 955845110b
commit 7f8544373f
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
3 changed files with 5 additions and 8 deletions

View File

@ -177,11 +177,7 @@ pub fn cache_image(pd: &PodcastCoverQuery) -> Option<String> {
return None; return None;
} }
let cache_download_fold = format!( let cache_download_fold = format!("{}{}", HAMMOND_CACHE.to_str()?, pd.title().to_owned());
"{}{}",
HAMMOND_CACHE.to_str().unwrap(),
pd.title().to_owned()
);
// Weird glob magic. // Weird glob magic.
if let Ok(mut foo) = glob(&format!("{}/cover.*", cache_download_fold)) { if let Ok(mut foo) = glob(&format!("{}/cover.*", cache_download_fold)) {
@ -196,7 +192,7 @@ pub fn cache_image(pd: &PodcastCoverQuery) -> Option<String> {
DirBuilder::new() DirBuilder::new()
.recursive(true) .recursive(true)
.create(&cache_download_fold) .create(&cache_download_fold)
.unwrap(); .ok()?;
match download_into(&cache_download_fold, "cover", &url, None) { match download_into(&cache_download_fold, "cover", &url, None) {
Ok(path) => { Ok(path) => {

View File

@ -20,8 +20,9 @@ pub struct Progress {
impl Progress { impl Progress {
pub fn get_fraction(&self) -> f64 { pub fn get_fraction(&self) -> f64 {
info!("Progress: {:?}", self);
let ratio = self.downloaded_bytes as f64 / self.total_bytes as f64; let ratio = self.downloaded_bytes as f64 / self.total_bytes as f64;
debug!("{:?}", self);
debug!("Ratio completed: {}", ratio);
if ratio >= 1.0 { if ratio >= 1.0 {
return 1.0; return 1.0;

View File

@ -77,7 +77,7 @@ impl Default for EpisodesView {
impl EpisodesView { impl EpisodesView {
pub fn new(sender: Sender<Action>) -> Arc<EpisodesView> { pub fn new(sender: Sender<Action>) -> Arc<EpisodesView> {
let view = EpisodesView::default(); 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(); let now_utc = Utc::now();
episodes.into_iter().for_each(|mut ep| { episodes.into_iter().for_each(|mut ep| {