pub(crate) async fn download_resource(
    path: String,
    url: String,
    quality: MediaQuality,
) -> Result<(), Error> {
    use async_std::fs::File;
    use async_std::io::Write;

    let parsed_url = parse_url(url, quality);
    log::debug!("Downloading resource: {}", parsed_url);

    let content = surf::get(parsed_url).recv_bytes().await?;

    let mut file = File::create(path).await?;
    file.write(&content[..]).await?;

    Ok(())
}
///This function receives a path, an IGDB provided url and it normalices the path and downloads
/// the resource to the specified path file using the specified MediaQuality"
This function receives a path, an IGDB provided url and it normalices the path and downloads
the resource to the specified path file using the specified MediaQuality"
This function receives a path an IGDB provided url and it normalices the path and downloads the resource to the specified path file using the specified MediaQuality "
pub(crate) async fn download_resource(
    path: String,
    url: String,
    quality: MediaQuality,
) -> Result<(), Error> {
    use async_std::fs::File;
    use async_std::io::Write;
    let parsed_url = parse_url(url, quality);
    log::debug!("Downloading resource: {}", parsed_url);
    let content = surf::get(parsed_url).recv_bytes().await?;
    let mut file = File::create(path).await?;
    file.write(&content[..]).await?;
    Ok(())
}
pub ( crate ) async fn download_resource ( path : String , url : String , quality : MediaQuality , ) -> Result < ( ) , Error > { use async_std :: fs :: File ; use async_std :: io :: Write ; let parsed_url = parse_url ( url , quality ) ; log :: debug ! ( " " parsed_url ) ; let content = surf :: get ( parsed_url ) . recv_bytes ( ) . await ? ; let mut file = File :: create ( path ) . await ? ; file . write ( & content [ .. ] ) . await ? ; Ok ( ( ) ) }
This function receives a path, an IGDB provided url and it normalices the path and downloads
the resource to the specified path file using the specified MediaQuality"
This function receives a path an IGDB provided url and it normalices the path and downloads the resource to the specified path file using the specified MediaQuality "
path
String
url
String
quality
MediaQuality
path
String
url
String
quality
MediaQuality