Skip to content

Commit

Permalink
Merge pull request #354 from Dage-Hoo/main
Browse files Browse the repository at this point in the history
Trying to fix issues#300
  • Loading branch information
ParaN3xus authored Aug 3, 2024
2 parents 2c12a6d + e05cac1 commit 702dc66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions phira/src/client/model/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ impl Roles {
}
}

#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
#[serde(default)]
pub struct User {
pub id: i32,
pub name: String,
Expand All @@ -96,7 +97,6 @@ pub struct User {
pub bio: Option<String>,
pub exp: i64,
pub rks: f32,
#[serde(default)]
pub roles: i32,

pub joined: DateTime<Utc>,
Expand Down
12 changes: 11 additions & 1 deletion phira/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ impl Data {
let entry = entry?;
let filename = entry.file_name();
let filename = filename.to_str().unwrap();
let filename = format!("download/{filename}");
let Ok(id): Result<i32, _> = filename.parse() else { continue };
let filename = format!("download/{filename}");
if occurred.contains(&filename) {
continue;
}
Expand All @@ -139,6 +139,16 @@ impl Data {
});
}
}
let respacks: HashSet<_> = self.respacks.iter().map(|s| s.clone()).collect();
for entry in std::fs::read_dir(dir::respacks()?)? {
let entry = entry?;
let filename = entry.file_name();
let filename = filename.to_str().unwrap().to_string();
if respacks.contains(&filename) {
continue;
}
self.respacks.push(filename);
}
if let Some(res_pack_path) = &mut self.config.res_pack_path {
if res_pack_path.starts_with('/') {
// for compatibility
Expand Down

0 comments on commit 702dc66

Please sign in to comment.