Skip to content

Commit

Permalink
track shiny
Browse files Browse the repository at this point in the history
  • Loading branch information
kr45732 committed Jan 31, 2024
1 parent 3a867b0 commit 0eaf095
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ fn parse_auctions(
}
}
}
if extra_attrs.is_shiny() {
lowestbin_id.push_str("_SHINY");
}

if is_full_update {
update_lower_else_insert(&lowestbin_id, lowestbin_price, bin_prices);
Expand Down Expand Up @@ -697,6 +700,9 @@ async fn parse_ended_auctions(
}
}
}
if extra_attrs.is_shiny() {
id.push_str("_SHINY");
}

if update_average_bin && auction.bin {
update_average_map(avg_bin_prices, &id, auction.price, nbt.count);
Expand Down
9 changes: 9 additions & 0 deletions src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,18 @@ pub struct PartialExtraAttr {
pub ethermerge: Option<i16>,
pub ability_scroll: Option<Vec<String>>,
pub gems: Option<DashMap<String, Value>>,
pub is_shiny: Option<i16>,
}

impl PartialExtraAttr {
pub fn is_shiny(&self) -> bool {
if let Some(is_shiny_value) = &self.is_shiny {
return is_shiny_value == &1;
}

false
}

pub fn get_stars(&self) -> Option<i16> {
if self.upgrade_level.is_some() {
self.upgrade_level
Expand Down

0 comments on commit 0eaf095

Please sign in to comment.