rename import because I'm so dumb

This commit is contained in:
ALEZ-DEV 2024-05-04 22:07:11 +02:00
parent 1342c7e2fe
commit 05b79adbc3
8 changed files with 23 additions and 21 deletions

View File

@ -9,8 +9,9 @@ name = "babylonia-terminal-cli"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
babylonia-terminal-sdk = { path = "./../babylonia-terminal-sdk" }
downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
babylonia-terminal-sdk = "0.1.0" # { path = "./../babylonia-terminal-sdk" }
# downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
downloader-for-babylonia-terminal = "0.1.0"
indicatif = "0.17.8"
log = "0.4.21"
simple_logger = "4.3.3"

View File

@ -65,7 +65,7 @@ dependencies = [
"chksum-md5",
"dirs",
"dotenv",
"downloader",
"downloader-for-babylonia-terminal",
"flate2",
"fs_extra",
"log",
@ -292,9 +292,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "downloader"
version = "0.2.7"
source = "git+https://github.com/ALEZ-DEV/downloader#5572a0875ec4f04b0514342f9acff21252beb579"
name = "downloader-for-babylonia-terminal"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "075dd494fe6741db4ecbd43fde70a104bebd4592dbe8a9efce1d7072e20b9da5"
dependencies = [
"futures",
"rand",

View File

@ -10,7 +10,7 @@ anyhow = "1.0.81"
chksum-md5 = { version = "0.0.0", features = ["reader"] }
dirs = "5.0.1"
dotenv = "0.15.0"
downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
downloader-for-babylonia-terminal = "0.1.0" # { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
flate2 = "1.0.28"
fs_extra = "1.3.0"
log = "0.4.21"

View File

@ -1,6 +1,6 @@
use std::{path::PathBuf, sync::Arc};
use downloader::progress::Reporter;
use downloader_for_babylonia_terminal::progress::Reporter;
pub trait ComponentDownloader {
#[allow(async_fn_in_trait)]

View File

@ -3,7 +3,7 @@ use std::{
path::PathBuf,
};
use downloader::Downloader;
use downloader_for_babylonia_terminal::Downloader;
use flate2::read::GzDecoder;
use tar::Archive;
use tokio::fs::remove_dir_all;
@ -33,7 +33,7 @@ impl<'a> DXVKComponent<'a> {
impl<'a> GithubRequester for DXVKComponent<'a> {}
impl<'a> ComponentDownloader for DXVKComponent<'a> {
async fn install<P: downloader::progress::Reporter + 'static>(
async fn install<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>(
&self,
progress: Option<std::sync::Arc<P>>,
) -> anyhow::Result<()> {
@ -63,7 +63,7 @@ impl<'a> ComponentDownloader for DXVKComponent<'a> {
Ok(())
}
async fn download<P: downloader::progress::Reporter + 'static>(
async fn download<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>(
output_dir: &std::path::PathBuf,
progress: Option<std::sync::Arc<P>>,
) -> anyhow::Result<std::path::PathBuf> {
@ -78,7 +78,7 @@ impl<'a> ComponentDownloader for DXVKComponent<'a> {
.download_folder(output_dir)
.parallel_requests(1)
.build()?;
let mut dl = downloader::Download::new(&asset.browser_download_url);
let mut dl = downloader_for_babylonia_terminal::Download::new(&asset.browser_download_url);
if let Some(p) = progress {
dl = dl.progress(p);
}

View File

@ -4,7 +4,7 @@ use std::sync::Arc;
use std::time::Duration;
use std::vec;
use downloader::Downloader;
use downloader_for_babylonia_terminal::Downloader;
use log::debug;
use log::info;
use tokio::fs::{create_dir_all, remove_file};
@ -60,7 +60,7 @@ impl GameComponent {
Ok(to_download)
}
fn update_progress<P: downloader::progress::Reporter + 'static>(
fn update_progress<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>(
progress: Arc<P>,
max_size: u64,
game_dir: PathBuf,
@ -93,7 +93,7 @@ impl GameComponent {
impl GithubRequester for GameComponent {}
impl ComponentDownloader for GameComponent {
async fn install<P: downloader::progress::Reporter + 'static>(
async fn install<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>(
&self,
progress: Option<std::sync::Arc<P>>,
) -> anyhow::Result<()> {
@ -103,7 +103,7 @@ impl ComponentDownloader for GameComponent {
Ok(())
}
async fn download<P: downloader::progress::Reporter + 'static>(
async fn download<P: downloader_for_babylonia_terminal::progress::Reporter + 'static>(
output_dir: &std::path::PathBuf,
progress: Option<std::sync::Arc<P>>,
) -> anyhow::Result<std::path::PathBuf> {
@ -154,7 +154,7 @@ impl ComponentDownloader for GameComponent {
&game_info.get_resource_base_path(),
);
debug!("starting download for {}", url);
let mut dl = downloader::Download::new_with_output(
let mut dl = downloader_for_babylonia_terminal::Download::new_with_output(
&url,
output_path
.get(i)
@ -165,7 +165,7 @@ impl ComponentDownloader for GameComponent {
dl
})
.collect::<Vec<downloader::Download>>();
.collect::<Vec<downloader_for_babylonia_terminal::Download>>();
downloader.async_download(&to_download).await?;
}

View File

@ -5,7 +5,7 @@ use std::{
sync::Arc,
};
use downloader::{progress::Reporter, Downloader};
use downloader_for_babylonia_terminal::{progress::Reporter, Downloader};
use flate2::read::GzDecoder;
use log::debug;
use tar::Archive;
@ -54,7 +54,7 @@ impl ComponentDownloader for ProtonComponent {
.parallel_requests(1)
.build()?;
let mut dl = downloader::Download::new(&asset.browser_download_url);
let mut dl = downloader_for_babylonia_terminal::Download::new(&asset.browser_download_url);
if let Some(p) = progress {
dl = dl.progress(p);
}

View File

@ -1,6 +1,6 @@
use std::{path::PathBuf, sync::Arc};
use downloader::progress::Reporter;
use downloader_for_babylonia_terminal::progress::Reporter;
use log::{debug, info};
use tokio::fs::create_dir_all;
use wincompatlib::prelude::*;