mirror of
https://github.com/OMGeeky/twitch_data.git
synced 2026-01-25 03:00:30 +01:00
configurable amount of download threads
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "twitch_data"
|
name = "twitch_data"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# 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]
|
||||||
downloader_config = { git = "https://github.com/OMGeeky/downloader_config" }
|
downloader_config = { version="0.3.0", git = "https://github.com/OMGeeky/downloader_config" }
|
||||||
exponential_backoff = { git = "https://github.com/OMGeeky/exponential_backoff" }
|
exponential_backoff = { git = "https://github.com/OMGeeky/exponential_backoff" }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -537,7 +537,8 @@ impl<'a> TwitchClient<'a> {
|
|||||||
url: &String,
|
url: &String,
|
||||||
folder_path: &PathBuf,
|
folder_path: &PathBuf,
|
||||||
) -> Result<Vec<Option<PathBuf>>> {
|
) -> Result<Vec<Option<PathBuf>>> {
|
||||||
let mut amount_of_threads = 100; //TODO: make this configurable (downloader_config)
|
let config = load_config();
|
||||||
|
let mut amount_of_threads: u64 = config.twitch_downloader_thread_count;
|
||||||
trace!("downloading all parts of video: {}", url);
|
trace!("downloading all parts of video: {}", url);
|
||||||
let base_url = get_base_url(&url);
|
let base_url = get_base_url(&url);
|
||||||
info!("getting parts");
|
info!("getting parts");
|
||||||
@@ -546,6 +547,7 @@ impl<'a> TwitchClient<'a> {
|
|||||||
info!("getting parts ...Done");
|
info!("getting parts ...Done");
|
||||||
|
|
||||||
let amount_of_parts = parts.len();
|
let amount_of_parts = parts.len();
|
||||||
|
let amount_of_parts = amount_of_parts as u64;
|
||||||
info!("part count: {}", amount_of_parts);
|
info!("part count: {}", amount_of_parts);
|
||||||
if amount_of_parts < 1 {
|
if amount_of_parts < 1 {
|
||||||
return Err(DownloadError::new("No parts found").into());
|
return Err(DownloadError::new("No parts found").into());
|
||||||
|
|||||||
Reference in New Issue
Block a user