@ -14,7 +14,7 @@ mod tasklist;
#[ macro_use ]
#[ macro_use ]
mod progress ;
mod progress ;
//TODO: Create a module for temp files, pass the temp file to `perform` and do the regex fixing after `perform`
//TODO: Create a module for temp files, pass the temp file to `perform` and do the base64 fixing after `perform`
/// Download a loli async
/// Download a loli async
pub async fn perform ( url : impl AsRef < str > , path : impl AsRef < Path > , mut progress : progress ::CommandSender ) -> Result < ( ) , error ::Error >
pub async fn perform ( url : impl AsRef < str > , path : impl AsRef < Path > , mut progress : progress ::CommandSender ) -> Result < ( ) , error ::Error >
@ -84,7 +84,7 @@ pub async fn work(conf: config::Config) -> Result<(), Box<dyn std::error::Error>
//println!("Starting download ({})...", url);
//println!("Starting download ({})...", url);
prog . println ( format! ( "Starting download ({})..." , url ) ) . await . expect ( "fatal" ) ;
prog . println ( format! ( "Starting download ({})..." , url ) ) . await . expect ( "fatal" ) ;
let path = match path {
let path = match path {
config ::OutputType ::File ( file ) = > file ,
config ::OutputType ::File ( file ) = > file , //TODO: Download to temp file, memmap to str slice and then base64 decode. Also, determine if we need .png or .jpg from header.
config ::OutputType ::Directory ( dir ) = > {
config ::OutputType ::Directory ( dir ) = > {
//TODO: Implement downloading to temp and renaming to hash
//TODO: Implement downloading to temp and renaming to hash
unimplemented! ( ) ;
unimplemented! ( ) ;