my brain isnt work
This commit is contained in:
parent
7a6134b075
commit
8b414b5181
10
src/lib.rs
10
src/lib.rs
|
@ -235,3 +235,13 @@ pub async fn get_page(date: &str, config: &Config) -> Page {
|
||||||
cached,
|
cached,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn current_page(config: &Config) -> Page {
|
||||||
|
let page = get_page(&config.latest_date[..], config).await;
|
||||||
|
if page.cached {
|
||||||
|
page
|
||||||
|
} else {
|
||||||
|
cache::download_page_image(&config.cache_folder[..], &page).await;
|
||||||
|
page
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue