Add search to GUI and minor changes to Theseus.

This commit is contained in:
Matthew Reid
2023-01-02 00:41:09 -07:00
parent 548139ff8a
commit 67742cb238
4 changed files with 22 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ use std::collections::LinkedList;
const METADATA_URL: &str = "https://meta.modrinth.com/gamedata";
const METADATA_DB_FIELD: &[u8] = b"metadata";
const RETRY_ATTEMPTS: i32 = 3;
// TODO: store as subtree in database
#[derive(Encode, Decode, Debug)]
@@ -49,6 +50,7 @@ impl Metadata {
})
}
// Attempt to fetch metadata and store in sled DB
#[tracing::instrument(skip_all)]
pub async fn init(db: &sled::Db) -> crate::Result<Self> {
let mut metadata = None;
@@ -66,7 +68,7 @@ impl Metadata {
}
let mut fetch_futures = LinkedList::new();
for _ in 0..3 {
for _ in 0..RETRY_ATTEMPTS {
fetch_futures.push_back(Self::fetch().boxed());
}

View File

@@ -21,6 +21,7 @@ pub const SUPPORTED_ICON_FORMATS: &[&'static str] = &[
"mp4",
];
// Represent a Minecraft instance.
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Profile {
#[serde(skip)]