From 2faf8038fe4bb653a85f80b386336b59e458276d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20W=C3=B6lfer?= Date: Tue, 12 Aug 2025 21:21:47 +0200 Subject: [PATCH] Minor testing --- emeline.json | 1 + src/dance_info.rs | 2 ++ src/worldsdc/mod.rs | 28 ++++++++++++++++++++++++---- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 emeline.json diff --git a/emeline.json b/emeline.json new file mode 100644 index 0000000..94c30f0 --- /dev/null +++ b/emeline.json @@ -0,0 +1 @@ +{"leader":{"type":"dancer","dancer":{"id":7157,"first_name":"Emeline","last_name":"Rochefeuille","wscid":7537},"placements":[],"recent_year":0},"follower":{"type":"dancer","dancer":{"id":7157,"first_name":"Emeline","last_name":"Rochefeuille","wscid":7537},"level":{"required":"CHMP","allowed":"CHMP","reason":""},"placements":{"West Coast Swing":{"CHMP":{"division":{"id":7,"name":"Champions","abbreviation":"CHMP"},"total_points":54,"wscid":7537,"competitions":[{"role":"follower","points":3,"event":{"id":282,"name":"German Open West Coast Swing","location":"Freiburg, Baden-W\u00fcrttemberg, Germany","url":"https:\/\/go-wcs.com","date":"August 2025"},"result":"1"},{"role":"follower","points":3,"event":{"id":154,"name":"UK WCS Championships","location":"Sipson, West Drayton, London, UK","url":"http:\/\/www.ukwcschamps.com","date":"March 2025"},"result":"1"},{"role":"follower","points":3,"event":{"id":68,"name":"The Open World Swing Dance Championships","location":"Burbank, CA","url":"http:\/\/www.theopenswing.com","date":"December 2024"},"result":"3"},{"role":"follower","points":2,"event":{"id":224,"name":"Midwest Westie Fest","location":"Overland Park, KS, United States","url":"http:\/\/midwestwestiefest.com","date":"July 2024"},"result":"2"},{"role":"follower","points":4,"event":{"id":18,"name":"Easter Swing","location":"Seattle, WA, United States","url":"https:\/\/www.easterswing.org\/","date":"April 2024"},"result":"2"},{"role":"follower","points":1,"event":{"id":186,"name":"West in Lyon","location":"Lyon, Rh\u00f4ne, France","url":"http:\/\/www.west-in-lyon.fr","date":"March 2024"},"result":"3"},{"role":"follower","points":1,"event":{"id":184,"name":"BudaFest Open WCS Championships","location":"Budapest, Budapest, Hungary","url":"http:\/\/wcs-budafest.com","date":"January 2024"},"result":"5"},{"role":"follower","points":1,"event":{"id":68,"name":"US Open Swing Dance Championships","location":"Burbank, CA","url":"https:\/\/usopenswing.com\/","date":"November 2023"},"result":"F"},{"role":"follower","points":4,"event":{"id":135,"name":"Desert City Swing","location":"Phoenix, AZ","url":"http:\/\/www.desertcityswing.com","date":"September 2023"},"result":"2"},{"role":"follower","points":6,"event":{"id":92,"name":"MADjam (Mid Atlantic Dance Jam)","location":"Reston, VA","url":"http:\/\/www.atlanticdancejam.com","date":"March 2023"},"result":"1"},{"role":"follower","points":2,"event":{"id":289,"name":"Swingvester","location":"Wels, O\u00d6, Austria","url":"http:\/\/www.swingvester.com","date":"January 2023"},"result":"2"},{"role":"follower","points":4,"event":{"id":135,"name":"Desert City Swing","location":"Phoenix, AZ","url":"http:\/\/www.desertcityswing.com","date":"September 2022"},"result":"2"},{"role":"follower","points":4,"event":{"id":212,"name":"The After Party","location":"Irvine, CA, ","url":"http:\/\/www.tapwcs.com","date":"December 2019"},"result":"4"},{"role":"follower","points":4,"event":{"id":53,"name":"Summer Hummer","location":"Boston, MA, United States","url":"http:\/\/www.summerhummerboston.com\/","date":"August 2019"},"result":"2"},{"role":"follower","points":1,"event":{"id":212,"name":"The After Party (TAP)","location":"Irvine, CA, ","url":"http:\/\/www.tapwcs.com","date":"December 2018"},"result":"5"},{"role":"follower","points":1,"event":{"id":53,"name":"Summer Hummer","location":"Boston, MA, United States","url":"http:\/\/www.dancepros.net\/","date":"August 2018"},"result":"5"},{"role":"follower","points":3,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2018"},"result":"1"},{"role":"follower","points":1,"event":{"id":142,"name":"The Chicago Classic","location":"Chicago, IL, United States","url":"https:\/\/thechicagoclassic.com\/","date":"March 2018"},"result":"5"},{"role":"follower","points":2,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2017"},"result":"4"},{"role":"follower","points":1,"event":{"id":135,"name":"Desert City Swing","location":"Phoenix, AZ","url":"","date":"September 2016"},"result":"F"},{"role":"follower","points":3,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2016"},"result":"3"}],"adv_sliding":[],"as_sliding":[]},"ALS":{"division":{"id":8,"name":"All-Stars","abbreviation":"ALS"},"total_points":69,"wscid":7537,"competitions":[{"role":"follower","points":10,"event":{"id":184,"name":"BudaFest Open WCS Championships","location":"Budapest, Budapest, Hungary","url":"http:\/\/wcs-budafest.com","date":"January 2017"},"result":"1"},{"role":"follower","points":4,"event":{"id":229,"name":"Scandinavian Open","location":"Stockholm, Sweden, Sweden","url":"http:\/\/www.snowcs.se","date":"November 2016"},"result":"2"},{"role":"follower","points":4,"event":{"id":257,"name":"Italian Open","location":"Milan, Italy ","url":"","date":"October 2016"},"result":"2"},{"role":"follower","points":5,"event":{"id":220,"name":"D-Townswing","location":"Boston Club, NRW, Germany","url":"http:\/\/www.d-townswing.com","date":"June 2016"},"result":"1"},{"role":"follower","points":4,"event":{"id":175,"name":"French Open West Coast Swing","location":"PARIS, France","url":"http:\/\/www.fowcs.com","date":"May 2016"},"result":"2"},{"role":"follower","points":5,"event":{"id":253,"name":"Nordic WCS Championships","location":"Stockholm, Stockholm, Sweden","url":"http:\/\/www.nordicwcschamps.com","date":"May 2016"},"result":"1"},{"role":"follower","points":5,"event":{"id":184,"name":"BudaFest Open WCS Championships","location":"Budapest, Budapest, Hungary","url":"http:\/\/wcs-budafest.com","date":"January 2016"},"result":"1"},{"role":"follower","points":5,"event":{"id":175,"name":"French Open West Coast Swing","location":"PARIS, France","url":"http:\/\/www.fowcs.com","date":"May 2015"},"result":"1"},{"role":"follower","points":3,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2015"},"result":"3"},{"role":"follower","points":4,"event":{"id":184,"name":"BudaFest Open WCS Championships","location":"Budapest, Budapest, Hungary","url":"http:\/\/wcs-budafest.com","date":"January 2015"},"result":"2"},{"role":"follower","points":4,"event":{"id":68,"name":"US Open Swing Dance Championships","location":"Burbank, CA","url":"","date":"November 2014"},"result":"4"},{"role":"follower","points":4,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2014"},"result":"2"},{"role":"follower","points":8,"event":{"id":68,"name":"US Open Swing Dance Championships","location":"Burbank, CA","url":"","date":"December 2013"},"result":"2"},{"role":"follower","points":4,"event":{"id":165,"name":"Midland Swing Open","location":"London, UK","url":"http:\/\/www.MidlandSwingOpen.com","date":"September 2013"},"result":"2"}],"adv_sliding":[],"as_sliding":[]},"ADV":{"division":{"id":6,"name":"Advanced","abbreviation":"ADV"},"total_points":59,"wscid":7537,"competitions":[{"role":"follower","points":10,"event":{"id":61,"name":"SwingDiego","location":"San Diego, CA","url":"","date":"May 2014"},"result":"3"},{"role":"follower","points":5,"event":{"id":164,"name":"Sea Sun and Swing","location":"La Grande Motte, Herault, France","url":"http:\/\/www.seasunswing.fr","date":"August 2013"},"result":"1"},{"role":"follower","points":5,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2013"},"result":"1"},{"role":"follower","points":4,"event":{"id":68,"name":"US Open Swing Dance Championships","location":"Burbank, CA","url":"","date":"November 2012"},"result":"4"},{"role":"follower","points":2,"event":{"id":166,"name":"London SWINGvitational","location":"Windsor, UK","url":"","date":"November 2012"},"result":"4"},{"role":"follower","points":4,"event":{"id":53,"name":"Summer Hummer","location":"Boston, MA, United States","url":"https:\/\/summerhummerboston.com\/","date":"August 2012"},"result":"4"},{"role":"follower","points":6,"event":{"id":51,"name":"Palm Springs Summer Dance Classic","location":"Palm Springs, CA","url":"","date":"August 2012"},"result":"3"},{"role":"follower","points":6,"event":{"id":61,"name":"SwingDiego","location":"San Diego, CA","url":"","date":"May 2012"},"result":"5"},{"role":"follower","points":5,"event":{"id":154,"name":"UK WCS Dance Championships","location":"Sipson, West Drayton, London, UK","url":"https:\/\/www.ukwcschamps.com\/","date":"April 2012"},"result":"1"},{"role":"follower","points":10,"event":{"id":92,"name":"Mid-Atlantic Dance Jam","location":"Reston, VA","url":"http:\/\/www.atlanticdancejam.com","date":"March 2012"},"result":"3"},{"role":"follower","points":2,"event":{"id":175,"name":"French Open West Coast Swing","location":"PARIS, France","url":"http:\/\/www.fowcs.com","date":"June 2011"},"result":"4"}],"adv_sliding":[],"as_sliding":[]},"INT":{"division":{"id":5,"name":"Intermediate","abbreviation":"INT"},"total_points":26,"wscid":7537,"competitions":[{"role":"follower","points":8,"event":{"id":9,"name":"Boston Tea Party","location":"Newton, MA","url":"http:\/\/teapartyswings.com","date":"March 2011"},"result":"2"},{"role":"follower","points":4,"event":{"id":142,"name":"The Chicago Classic","location":"Chicago, IL, United States","url":"www.TheChicagoClassic.com","date":"March 2011"},"result":"4"},{"role":"follower","points":4,"event":{"id":8,"name":"Boogie By The Bay","location":"San Francisco, CA","url":"","date":"October 2010"},"result":"4"},{"role":"follower","points":2,"event":{"id":164,"name":"Sea Sun and Swing","location":"La Grande Motte, Herault, France","url":"http:\/\/www.seasunswing.fr","date":"August 2010"},"result":"4"},{"role":"follower","points":8,"event":{"id":53,"name":"Summer Hummer","location":"Boston, MA, United States","url":"https:\/\/summerhummerboston.com\/","date":"August 2010"},"result":"2"}],"adv_sliding":[],"as_sliding":[]},"NOV":{"division":{"id":4,"name":"Novice","abbreviation":"NOV"},"total_points":23,"wscid":7537,"competitions":[{"role":"follower","points":15,"event":{"id":22,"name":"USA Grand Nationals","location":"Atlanta, GA, GA, USA","url":"http:\/\/www.usagrandnationals.com","date":"May 2010"},"result":"1"},{"role":"follower","points":8,"event":{"id":154,"name":"UK WCS Dance Championships","location":"Sipson, West Drayton, London, UK","url":"https:\/\/www.ukwcschamps.com\/","date":"April 2010"},"result":"4"}],"adv_sliding":[],"as_sliding":[]}}},"recent_year":"2025"},"non_dominate_lookup":[{"competing_as":"CHMP","non_dominate_recommended":"ALS","non_dominate_allowed":"ADV","non_dominate_required":null,"message":"If competing in CHMP for your primary role, we recommend ALS for your secondary role. However, you are allowed to dance ADV."}],"dominate_data":{"type":"dancer","dancer":{"id":7157,"first_name":"Emeline","last_name":"Rochefeuille","wscid":7537},"level":{"required":"CHMP","allowed":"CHMP","reason":""},"placements":{"West Coast Swing":{"CHMP":{"division":{"id":7,"name":"Champions","abbreviation":"CHMP"},"total_points":54,"wscid":7537,"competitions":[{"role":"follower","points":3,"event":{"id":282,"name":"German Open West Coast Swing","location":"Freiburg, Baden-W\u00fcrttemberg, Germany","url":"https:\/\/go-wcs.com","date":"August 2025"},"result":"1"},{"role":"follower","points":3,"event":{"id":154,"name":"UK WCS Championships","location":"Sipson, West Drayton, London, UK","url":"http:\/\/www.ukwcschamps.com","date":"March 2025"},"result":"1"},{"role":"follower","points":3,"event":{"id":68,"name":"The Open World Swing Dance Championships","location":"Burbank, CA","url":"http:\/\/www.theopenswing.com","date":"December 2024"},"result":"3"},{"role":"follower","points":2,"event":{"id":224,"name":"Midwest Westie Fest","location":"Overland Park, KS, United States","url":"http:\/\/midwestwestiefest.com","date":"July 2024"},"result":"2"},{"role":"follower","points":4,"event":{"id":18,"name":"Easter Swing","location":"Seattle, WA, United States","url":"https:\/\/www.easterswing.org\/","date":"April 2024"},"result":"2"},{"role":"follower","points":1,"event":{"id":186,"name":"West in Lyon","location":"Lyon, Rh\u00f4ne, France","url":"http:\/\/www.west-in-lyon.fr","date":"March 2024"},"result":"3"},{"role":"follower","points":1,"event":{"id":184,"name":"BudaFest Open WCS Championships","location":"Budapest, Budapest, Hungary","url":"http:\/\/wcs-budafest.com","date":"January 2024"},"result":"5"},{"role":"follower","points":1,"event":{"id":68,"name":"US Open Swing Dance Championships","location":"Burbank, CA","url":"https:\/\/usopenswing.com\/","date":"November 2023"},"result":"F"},{"role":"follower","points":4,"event":{"id":135,"name":"Desert City Swing","location":"Phoenix, AZ","url":"http:\/\/www.desertcityswing.com","date":"September 2023"},"result":"2"},{"role":"follower","points":6,"event":{"id":92,"name":"MADjam (Mid Atlantic Dance Jam)","location":"Reston, VA","url":"http:\/\/www.atlanticdancejam.com","date":"March 2023"},"result":"1"},{"role":"follower","points":2,"event":{"id":289,"name":"Swingvester","location":"Wels, O\u00d6, Austria","url":"http:\/\/www.swingvester.com","date":"January 2023"},"result":"2"},{"role":"follower","points":4,"event":{"id":135,"name":"Desert City Swing","location":"Phoenix, AZ","url":"http:\/\/www.desertcityswing.com","date":"September 2022"},"result":"2"},{"role":"follower","points":4,"event":{"id":212,"name":"The After Party","location":"Irvine, CA, ","url":"http:\/\/www.tapwcs.com","date":"December 2019"},"result":"4"},{"role":"follower","points":4,"event":{"id":53,"name":"Summer Hummer","location":"Boston, MA, United States","url":"http:\/\/www.summerhummerboston.com\/","date":"August 2019"},"result":"2"},{"role":"follower","points":1,"event":{"id":212,"name":"The After Party (TAP)","location":"Irvine, CA, ","url":"http:\/\/www.tapwcs.com","date":"December 2018"},"result":"5"},{"role":"follower","points":1,"event":{"id":53,"name":"Summer Hummer","location":"Boston, MA, United States","url":"http:\/\/www.dancepros.net\/","date":"August 2018"},"result":"5"},{"role":"follower","points":3,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2018"},"result":"1"},{"role":"follower","points":1,"event":{"id":142,"name":"The Chicago Classic","location":"Chicago, IL, United States","url":"https:\/\/thechicagoclassic.com\/","date":"March 2018"},"result":"5"},{"role":"follower","points":2,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2017"},"result":"4"},{"role":"follower","points":1,"event":{"id":135,"name":"Desert City Swing","location":"Phoenix, AZ","url":"","date":"September 2016"},"result":"F"},{"role":"follower","points":3,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2016"},"result":"3"}],"adv_sliding":[],"as_sliding":[]},"ALS":{"division":{"id":8,"name":"All-Stars","abbreviation":"ALS"},"total_points":69,"wscid":7537,"competitions":[{"role":"follower","points":10,"event":{"id":184,"name":"BudaFest Open WCS Championships","location":"Budapest, Budapest, Hungary","url":"http:\/\/wcs-budafest.com","date":"January 2017"},"result":"1"},{"role":"follower","points":4,"event":{"id":229,"name":"Scandinavian Open","location":"Stockholm, Sweden, Sweden","url":"http:\/\/www.snowcs.se","date":"November 2016"},"result":"2"},{"role":"follower","points":4,"event":{"id":257,"name":"Italian Open","location":"Milan, Italy ","url":"","date":"October 2016"},"result":"2"},{"role":"follower","points":5,"event":{"id":220,"name":"D-Townswing","location":"Boston Club, NRW, Germany","url":"http:\/\/www.d-townswing.com","date":"June 2016"},"result":"1"},{"role":"follower","points":4,"event":{"id":175,"name":"French Open West Coast Swing","location":"PARIS, France","url":"http:\/\/www.fowcs.com","date":"May 2016"},"result":"2"},{"role":"follower","points":5,"event":{"id":253,"name":"Nordic WCS Championships","location":"Stockholm, Stockholm, Sweden","url":"http:\/\/www.nordicwcschamps.com","date":"May 2016"},"result":"1"},{"role":"follower","points":5,"event":{"id":184,"name":"BudaFest Open WCS Championships","location":"Budapest, Budapest, Hungary","url":"http:\/\/wcs-budafest.com","date":"January 2016"},"result":"1"},{"role":"follower","points":5,"event":{"id":175,"name":"French Open West Coast Swing","location":"PARIS, France","url":"http:\/\/www.fowcs.com","date":"May 2015"},"result":"1"},{"role":"follower","points":3,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2015"},"result":"3"},{"role":"follower","points":4,"event":{"id":184,"name":"BudaFest Open WCS Championships","location":"Budapest, Budapest, Hungary","url":"http:\/\/wcs-budafest.com","date":"January 2015"},"result":"2"},{"role":"follower","points":4,"event":{"id":68,"name":"US Open Swing Dance Championships","location":"Burbank, CA","url":"","date":"November 2014"},"result":"4"},{"role":"follower","points":4,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2014"},"result":"2"},{"role":"follower","points":8,"event":{"id":68,"name":"US Open Swing Dance Championships","location":"Burbank, CA","url":"","date":"December 2013"},"result":"2"},{"role":"follower","points":4,"event":{"id":165,"name":"Midland Swing Open","location":"London, UK","url":"http:\/\/www.MidlandSwingOpen.com","date":"September 2013"},"result":"2"}],"adv_sliding":[],"as_sliding":[]},"ADV":{"division":{"id":6,"name":"Advanced","abbreviation":"ADV"},"total_points":59,"wscid":7537,"competitions":[{"role":"follower","points":10,"event":{"id":61,"name":"SwingDiego","location":"San Diego, CA","url":"","date":"May 2014"},"result":"3"},{"role":"follower","points":5,"event":{"id":164,"name":"Sea Sun and Swing","location":"La Grande Motte, Herault, France","url":"http:\/\/www.seasunswing.fr","date":"August 2013"},"result":"1"},{"role":"follower","points":5,"event":{"id":198,"name":"UK & European WCS Championships","location":"London, England","url":"","date":"April 2013"},"result":"1"},{"role":"follower","points":4,"event":{"id":68,"name":"US Open Swing Dance Championships","location":"Burbank, CA","url":"","date":"November 2012"},"result":"4"},{"role":"follower","points":2,"event":{"id":166,"name":"London SWINGvitational","location":"Windsor, UK","url":"","date":"November 2012"},"result":"4"},{"role":"follower","points":4,"event":{"id":53,"name":"Summer Hummer","location":"Boston, MA, United States","url":"https:\/\/summerhummerboston.com\/","date":"August 2012"},"result":"4"},{"role":"follower","points":6,"event":{"id":51,"name":"Palm Springs Summer Dance Classic","location":"Palm Springs, CA","url":"","date":"August 2012"},"result":"3"},{"role":"follower","points":6,"event":{"id":61,"name":"SwingDiego","location":"San Diego, CA","url":"","date":"May 2012"},"result":"5"},{"role":"follower","points":5,"event":{"id":154,"name":"UK WCS Dance Championships","location":"Sipson, West Drayton, London, UK","url":"https:\/\/www.ukwcschamps.com\/","date":"April 2012"},"result":"1"},{"role":"follower","points":10,"event":{"id":92,"name":"Mid-Atlantic Dance Jam","location":"Reston, VA","url":"http:\/\/www.atlanticdancejam.com","date":"March 2012"},"result":"3"},{"role":"follower","points":2,"event":{"id":175,"name":"French Open West Coast Swing","location":"PARIS, France","url":"http:\/\/www.fowcs.com","date":"June 2011"},"result":"4"}],"adv_sliding":[],"as_sliding":[]},"INT":{"division":{"id":5,"name":"Intermediate","abbreviation":"INT"},"total_points":26,"wscid":7537,"competitions":[{"role":"follower","points":8,"event":{"id":9,"name":"Boston Tea Party","location":"Newton, MA","url":"http:\/\/teapartyswings.com","date":"March 2011"},"result":"2"},{"role":"follower","points":4,"event":{"id":142,"name":"The Chicago Classic","location":"Chicago, IL, United States","url":"www.TheChicagoClassic.com","date":"March 2011"},"result":"4"},{"role":"follower","points":4,"event":{"id":8,"name":"Boogie By The Bay","location":"San Francisco, CA","url":"","date":"October 2010"},"result":"4"},{"role":"follower","points":2,"event":{"id":164,"name":"Sea Sun and Swing","location":"La Grande Motte, Herault, France","url":"http:\/\/www.seasunswing.fr","date":"August 2010"},"result":"4"},{"role":"follower","points":8,"event":{"id":53,"name":"Summer Hummer","location":"Boston, MA, United States","url":"https:\/\/summerhummerboston.com\/","date":"August 2010"},"result":"2"}],"adv_sliding":[],"as_sliding":[]},"NOV":{"division":{"id":4,"name":"Novice","abbreviation":"NOV"},"total_points":23,"wscid":7537,"competitions":[{"role":"follower","points":15,"event":{"id":22,"name":"USA Grand Nationals","location":"Atlanta, GA, GA, USA","url":"http:\/\/www.usagrandnationals.com","date":"May 2010"},"result":"1"},{"role":"follower","points":8,"event":{"id":154,"name":"UK WCS Dance Championships","location":"Sipson, West Drayton, London, UK","url":"https:\/\/www.ukwcschamps.com\/","date":"April 2010"},"result":"4"}],"adv_sliding":[],"as_sliding":[]}}},"recent_year":"2025"},"non_dominate_data":{"type":"dancer","dancer":{"id":7157,"first_name":"Emeline","last_name":"Rochefeuille","wscid":7537},"placements":[],"recent_year":0},"dancer_first":"Emeline","dancer_last":"Rochefeuille","dancer_wsdcid":7537,"dominate_role":"Primary Role Follower","non_dominate_role":"Secondary Role Leader","dominate_required":"CHMP","dominate_allowed":"CHMP","show_secondary_icons":0,"short_dominate_role":"Follower","short_non_dominate_role":"Leader","dominate_role_highest_level_points":54,"dominate_role_highest_level":"Champions","non_dominate_role_highest_level_points":"N\/A","non_dominate_role_highest_level":"N\/A","points_message":"","recent_year":"2025","is_pro":0} \ No newline at end of file diff --git a/src/dance_info.rs b/src/dance_info.rs index c560dea..7eba2eb 100644 --- a/src/dance_info.rs +++ b/src/dance_info.rs @@ -51,6 +51,8 @@ pub struct CompState { pub rank: DanceRank, pub points: u16, } + +#[derive(Debug)] pub struct DanceInfo { pub firstname: String, pub lastname: String, diff --git a/src/worldsdc/mod.rs b/src/worldsdc/mod.rs index 2dda556..cd62146 100644 --- a/src/worldsdc/mod.rs +++ b/src/worldsdc/mod.rs @@ -11,12 +11,15 @@ pub async fn fetch_wsdc_info(id: u32) -> Result { .map_err(DanceInfoError::ClientBuild)?; let mut params = HashMap::new(); + + let url = if cfg!(test) { + "https://o5grQU3Y.free.beeceptor.com/lookup2020/find" + } else { + "https://points.worldsdc.com/lookup2020/find" + }; params.insert("num", id.to_string()); let request = client - .request( - reqwest::Method::POST, - "https://points.worldsdc.com/lookup2020/find", - ) + .request(reqwest::Method::POST, url) .form(¶ms) .build() .map_err(DanceInfoError::RequestBuild)?; @@ -29,6 +32,23 @@ pub async fn fetch_wsdc_info(id: u32) -> Result { Ok(x.into()) } +#[test] +#[ignore = "Only run when the mock api is setup"] +fn test_fetch_wsdc() { + let rt = match tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + { + Ok(o) => o, + Err(e) => { + tracing::error!("Could not start runtime: {e}"); + return; + } + }; + let x = rt.block_on(fetch_wsdc_info(7)); + dbg!(x); +} + #[derive(thiserror::Error, Debug)] pub enum DanceInfoError { #[error("Failed to build client: {0}")]