mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
don't copy from db (#1136)
This commit is contained in:
Generated
-1
@@ -5709,7 +5709,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2474bd2e5029e7ccb6abb2ba48cf2383a333851dedf495901544281590c7da7f"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ postcard = { version = "1.1", features = ["use-std"] }
|
||||
clap = { version = "4.5", features = ["derive"] }
|
||||
reqwest = { version = "0.13", default-features = false, features = ["native-tls-vendored", "charset", "http2", "system-proxy", "json", "query"] }
|
||||
discord-rich-presence = "1.1"
|
||||
quick-xml = { version = "0.40", features = ["async-tokio"] }
|
||||
quick-xml = "0.40"
|
||||
|
||||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||
slint = { version = "1.16", default-features = false, features = ["compat-1-2", "std", "unstable-winit-030", "backend-winit", "renderer-femtovg-wgpu", "accessibility"], optional = true }
|
||||
|
||||
+7
-3
@@ -685,11 +685,10 @@ async fn load_no_intro(
|
||||
let mut reader = quick_xml::Reader::from_str(include_str!(
|
||||
"../../data/ui/Nintendo - Nintendo 64 (DB Export) (20260609-194259).xml"
|
||||
));
|
||||
let mut buf = Vec::new();
|
||||
let mut current_game = String::new();
|
||||
let mut map = no_intro_map.lock().await;
|
||||
loop {
|
||||
match reader.read_event_into_async(&mut buf).await {
|
||||
match reader.read_event() {
|
||||
Ok(quick_xml::events::Event::Start(e)) => {
|
||||
if e.name().as_ref() == b"game"
|
||||
&& let Ok(Some(name_attribute)) = e.try_get_attribute("name")
|
||||
@@ -698,12 +697,18 @@ async fn load_no_intro(
|
||||
current_game = name;
|
||||
}
|
||||
}
|
||||
Ok(quick_xml::events::Event::End(e)) => {
|
||||
if e.name().as_ref() == b"game" {
|
||||
current_game.clear();
|
||||
}
|
||||
}
|
||||
Ok(quick_xml::events::Event::Empty(e)) => {
|
||||
if e.name().as_ref() == b"file"
|
||||
&& let Ok(Some(format_attribute)) = e.try_get_attribute("format")
|
||||
&& format_attribute.value.as_ref() == b"BigEndian"
|
||||
&& let Ok(Some(sha256_attribute)) = e.try_get_attribute("sha256")
|
||||
&& let Ok(sha256) = String::from_utf8(sha256_attribute.value.into_owned())
|
||||
&& !current_game.is_empty()
|
||||
{
|
||||
map.insert(sha256.to_lowercase(), current_game.clone());
|
||||
}
|
||||
@@ -712,7 +717,6 @@ async fn load_no_intro(
|
||||
Ok(quick_xml::events::Event::Eof) => break,
|
||||
_ => (),
|
||||
}
|
||||
buf.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user