mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-18 07:51:47 +03:00
fix: (potentially) fixed a bug with pre-download button
This commit is contained in:
parent
c6eb063973
commit
dd85f1b6d3
2 changed files with 16 additions and 14 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -57,7 +57,8 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anime-game-core"
|
name = "anime-game-core"
|
||||||
version = "1.22.2"
|
version = "1.23.0"
|
||||||
|
source = "git+https://github.com/an-anime-team/anime-game-core?tag=1.23.0#9db1b598418c8c973b4e3afbdc17dcacc8511f3f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bzip2",
|
"bzip2",
|
||||||
|
@ -106,7 +107,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anime-launcher-sdk"
|
name = "anime-launcher-sdk"
|
||||||
version = "1.18.0"
|
version = "1.19.0"
|
||||||
|
source = "git+https://github.com/an-anime-team/anime-launcher-sdk?tag=1.19.0#18bbd738c9e941b76c1883a969cf9de87e724646"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anime-game-core",
|
"anime-game-core",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
@ -330,16 +330,16 @@ impl SimpleComponent for App {
|
||||||
let temp = config.launcher.temp.unwrap_or_else(std::env::temp_dir);
|
let temp = config.launcher.temp.unwrap_or_else(std::env::temp_dir);
|
||||||
|
|
||||||
let mut downloaded = temp.join(game.file_name().unwrap()).metadata()
|
let mut downloaded = temp.join(game.file_name().unwrap()).metadata()
|
||||||
.map(|metadata| Some(metadata.len()) == game.downloaded_size())
|
.map(|metadata| Some(metadata.len()) >= game.downloaded_size())
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
|
||||||
if downloaded {
|
if downloaded {
|
||||||
for voice in voices {
|
for voice in voices {
|
||||||
downloaded = !temp.join(voice.file_name().unwrap()).metadata()
|
downloaded = temp.join(voice.file_name().unwrap()).metadata()
|
||||||
.map(|metadata| Some(metadata.len()) == voice.downloaded_size())
|
.map(|metadata| Some(metadata.len()) >= voice.downloaded_size())
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
|
||||||
if downloaded {
|
if !downloaded {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,16 +358,16 @@ impl SimpleComponent for App {
|
||||||
let temp = config.launcher.temp.unwrap_or_else(std::env::temp_dir);
|
let temp = config.launcher.temp.unwrap_or_else(std::env::temp_dir);
|
||||||
|
|
||||||
let mut downloaded = temp.join(game.file_name().unwrap()).metadata()
|
let mut downloaded = temp.join(game.file_name().unwrap()).metadata()
|
||||||
.map(|metadata| Some(metadata.len()) == game.downloaded_size())
|
.map(|metadata| Some(metadata.len()) >= game.downloaded_size())
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
|
||||||
if downloaded {
|
if downloaded {
|
||||||
for voice in voices {
|
for voice in voices {
|
||||||
downloaded = !temp.join(voice.file_name().unwrap()).metadata()
|
downloaded = temp.join(voice.file_name().unwrap()).metadata()
|
||||||
.map(|metadata| Some(metadata.len()) == voice.downloaded_size())
|
.map(|metadata| Some(metadata.len()) >= voice.downloaded_size())
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
|
||||||
if downloaded {
|
if !downloaded {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue