diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-10-04 11:34:24 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-10-04 11:34:24 +0200 |
commit | 135a18f010e3cd6c33c27a4ff36a6e816e48eef1 (patch) | |
tree | 6b57570f5edcfde6c51953b9b6e5c53c1cbb9217 | |
parent | c2a7b7f3607a11c1560b429fd3bf19f1e7ee305c (diff) | |
download | ezau-135a18f010e3cd6c33c27a4ff36a6e816e48eef1.tar.gz ezau-135a18f010e3cd6c33c27a4ff36a6e816e48eef1.tar.bz2 ezau-135a18f010e3cd6c33c27a4ff36a6e816e48eef1.zip |
update to latest evtclib
There's a good chance that this version of evtclib will stay as 0.5, so
it's a good idea to adapt our code to the API changes (mainly using
evtclib::Encounter instead of evtclib::Boss).
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/categories.rs | 43 | ||||
-rw-r--r-- | src/main.rs | 4 |
4 files changed, 29 insertions, 22 deletions
@@ -251,7 +251,7 @@ dependencies = [ [[package]] name = "evtclib" version = "0.4.3" -source = "git+https://gitlab.com/dunj3/evtclib.git?rev=0441078#0441078a3a0dc2fb37971257cc78792b32c1a7bd" +source = "git+https://gitlab.com/dunj3/evtclib.git?rev=b6676565#b6676565c39bb6a2fe8f5f01218fe654ec4d2cb8" dependencies = [ "byteorder", "getset", @@ -13,7 +13,7 @@ log = "0.4.8" pretty_env_logger = "0.4.0" anyhow = "1.0.31" serenity = "0.8.6" -evtclib = { git = "https://gitlab.com/dunj3/evtclib.git", rev = "0441078" } +evtclib = { git = "https://gitlab.com/dunj3/evtclib.git", rev = "b6676565" } reqwest = { version = "0.10.6", features = ["json"] } serde = "1.0.111" chrono = "0.4.11" diff --git a/src/categories.rs b/src/categories.rs index 17b90b7..cf4c3de 100644 --- a/src/categories.rs +++ b/src/categories.rs @@ -1,4 +1,4 @@ -use evtclib::{Boss, Log}; +use evtclib::{Encounter, Log}; pub trait Categorizable { fn category(&self) -> &'static str; @@ -8,29 +8,36 @@ impl Categorizable for Log { fn category(&self) -> &'static str { if let Some(encounter) = self.encounter() { match encounter { - Boss::ValeGuardian | Boss::Gorseval | Boss::Sabetha => "Wing 1 (Spirit Vale)", - Boss::Slothasor | Boss::Matthias => "Wing 2 (Salvation Pass)", - Boss::KeepConstruct | Boss::Xera => "Wing 3 (Stronghold of the Faithful)", - Boss::Cairn | Boss::MursaatOverseer | Boss::Samarog | Boss::Deimos => { - "Wing 4 (Bastion of the Penitent)" + Encounter::ValeGuardian | Encounter::Gorseval | Encounter::Sabetha => { + "Wing 1 (Spirit Vale)" } - Boss::SoullessHorror | Boss::Dhuum => "Wing 5 (Hall of Chains)", - Boss::ConjuredAmalgamate | Boss::LargosTwins | Boss::Qadim => { + Encounter::Slothasor | Encounter::Matthias => "Wing 2 (Salvation Pass)", + Encounter::KeepConstruct | Encounter::Xera => "Wing 3 (Stronghold of the Faithful)", + Encounter::Cairn + | Encounter::MursaatOverseer + | Encounter::Samarog + | Encounter::Deimos => "Wing 4 (Bastion of the Penitent)", + Encounter::SoullessHorror | Encounter::VoiceInTheVoid => "Wing 5 (Hall of Chains)", + Encounter::ConjuredAmalgamate | Encounter::TwinLargos | Encounter::Qadim => { "Wing 6 (Mythwright Gambit)" } - Boss::CardinalAdina | Boss::CardinalSabir | Boss::QadimThePeerless => { - "Wing 7 (Key of Ahdashim)" + Encounter::CardinalAdina + | Encounter::CardinalSabir + | Encounter::QadimThePeerless => "Wing 7 (Key of Ahdashim)", + + Encounter::Ai => "100 CM (Sunqua Peak)", + Encounter::Skorvald | Encounter::Artsariiv | Encounter::Arkk => { + "99 CM (Shattered Observatory)" } + Encounter::MAMA | Encounter::Siax | Encounter::Ensolyss => "98 CM (Nightmare)", - Boss::Ai => "100 CM (Sunqua Peak)", - Boss::Skorvald | Boss::Artsariiv | Boss::Arkk => "99 CM (Shattered Observatory)", - Boss::MAMA | Boss::Siax | Boss::Ensolyss => "98 CM (Nightmare)", + Encounter::IcebroodConstruct + | Encounter::SuperKodanBrothers + | Encounter::FraenirOfJormag + | Encounter::Boneskinner + | Encounter::WhisperOfJormag => "Strike Mission", - Boss::IcebroodConstruct - | Boss::VoiceOfTheFallen - | Boss::FraenirOfJormag - | Boss::Boneskinner - | Boss::WhisperOfJormag => "Strike Mission", + _ => "Unknown", } } else { "Unknown" diff --git a/src/main.rs b/src/main.rs index 4052d59..e67bd1b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use std::{ use anyhow::{anyhow, Context, Result}; use clap::Clap; -use evtclib::{Boss, Compression, Log}; +use evtclib::{Compression, Encounter, Log}; use log::{debug, error, info, warn}; use notify::{self, DebouncedEvent, RecursiveMode, Watcher}; use regex::Regex; @@ -198,7 +198,7 @@ fn should_upload(config: &Config, log: &Log) -> bool { return false; } // Only upload Skorvald if it actually was in 100 CM (and not in in lower-tier or non-CM). - if log.encounter() == Some(Boss::Skorvald) && !log.is_cm() { + if log.encounter() == Some(Encounter::Skorvald) && !log.is_cm() { return false; } // Only upload logs that are long enough |