mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-15 09:11:28 +10:00
Merge branch 'main' into download-manager
This commit is contained in:
@ -205,15 +205,15 @@ impl GameDownloadAgent {
|
||||
let file = File::create(path.clone()).unwrap();
|
||||
let mut running_offset = 0;
|
||||
|
||||
for (i, length) in chunk.lengths.iter().enumerate() {
|
||||
for (index, length) in chunk.lengths.iter().enumerate() {
|
||||
contexts.push(DropDownloadContext {
|
||||
file_name: raw_path.to_string(),
|
||||
version: chunk.version_name.to_string(),
|
||||
offset: running_offset,
|
||||
index: i,
|
||||
index,
|
||||
game_id: game_id.to_string(),
|
||||
path: path.clone(),
|
||||
checksum: chunk.checksums[i].clone(),
|
||||
checksum: chunk.checksums[index].clone(),
|
||||
length: *length,
|
||||
});
|
||||
running_offset += *length as u64;
|
||||
|
||||
@ -8,14 +8,18 @@ pub enum DownloadThreadControlFlag {
|
||||
Stop,
|
||||
Go,
|
||||
}
|
||||
/// Go => true
|
||||
/// Stop => false
|
||||
impl From<DownloadThreadControlFlag> for bool {
|
||||
fn from(value: DownloadThreadControlFlag) -> Self {
|
||||
match value {
|
||||
DownloadThreadControlFlag::Stop => false,
|
||||
DownloadThreadControlFlag::Go => true,
|
||||
DownloadThreadControlFlag::Stop => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
/// true => Go
|
||||
/// false => Stop
|
||||
impl From<bool> for DownloadThreadControlFlag {
|
||||
fn from(value: bool) -> Self {
|
||||
match value {
|
||||
|
||||
Reference in New Issue
Block a user