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 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
babylonia-terminal-sdk = { path = "./../babylonia-terminal-sdk" } babylonia-terminal-sdk = "0.1.0" # { path = "./../babylonia-terminal-sdk" }
downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7", # downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
downloader-for-babylonia-terminal = "0.1.0"
indicatif = "0.17.8" indicatif = "0.17.8"
log = "0.4.21" log = "0.4.21"
simple_logger = "4.3.3" simple_logger = "4.3.3"

View File

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

View File

@ -10,7 +10,7 @@ anyhow = "1.0.81"
chksum-md5 = { version = "0.0.0", features = ["reader"] } chksum-md5 = { version = "0.0.0", features = ["reader"] }
dirs = "5.0.1" dirs = "5.0.1"
dotenv = "0.15.0" 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" flate2 = "1.0.28"
fs_extra = "1.3.0" fs_extra = "1.3.0"
log = "0.4.21" log = "0.4.21"

View File

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

View File

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

View File

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

View File

@ -5,7 +5,7 @@ use std::{
sync::Arc, sync::Arc,
}; };
use downloader::{progress::Reporter, Downloader}; use downloader_for_babylonia_terminal::{progress::Reporter, Downloader};
use flate2::read::GzDecoder; use flate2::read::GzDecoder;
use log::debug; use log::debug;
use tar::Archive; use tar::Archive;
@ -54,7 +54,7 @@ impl ComponentDownloader for ProtonComponent {
.parallel_requests(1) .parallel_requests(1)
.build()?; .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 { if let Some(p) = progress {
dl = dl.progress(p); dl = dl.progress(p);
} }

View File

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