#![warn(missing_docs)]
#[cfg(feature = "async")]
use async_trait::async_trait;
use bytes::Bytes;
use hex::{self, FromHexError};
use lazy_static::lazy_static;
use map::Map;
use serde::{Deserialize, Serialize};
use serde_json;
use std::convert::{From, TryFrom, TryInto};
use std::error::Error;
use std::fmt;
use std::num::ParseIntError;
use std::string::FromUtf8Error;
use url::Url;
use urlencoding::encode;
pub mod client;
pub mod map;
lazy_static! {
pub static ref BEATSAVER_URL: Url = Url::parse("https://beatsaver.com/").unwrap();
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct BeatSaverUser {
#[serde(alias = "_id")]
pub id: String,
pub username: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Page<T: Serialize> {
pub docs: Vec<T>,
#[serde(alias = "totalDocs")]
pub total_docs: usize,
#[serde(alias = "lastPage")]
pub last_page: usize,
#[serde(alias = "prevPage")]
pub prev_page: Option<usize>,
#[serde(alias = "nextPage")]
pub next_page: Option<usize>,
}
#[derive(Debug, Clone, PartialEq)]
pub enum MapIdError {
InvalidHash,
ParseIntError(ParseIntError),
}
impl fmt::Display for MapIdError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::InvalidHash => write!(f, "Specified hash is invalid"),
Self::ParseIntError(e) => e.fmt(f),
}
}
}
impl Error for MapIdError {}
impl From<ParseIntError> for MapIdError {
fn from(e: ParseIntError) -> Self {
Self::ParseIntError(e)
}
}
impl From<FromHexError> for MapIdError {
fn from(_: FromHexError) -> Self {
Self::InvalidHash
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum MapId {
Key(usize),
Hash(String),
}
impl TryFrom<String> for MapId {
type Error = MapIdError;
fn try_from(s: String) -> Result<Self, Self::Error> {
match s.len() {
40 => {
hex::decode(&s)?;
Ok(Self::Hash(s))
}
_ => Ok(Self::Key(usize::from_str_radix(s.as_str(), 16)?)),
}
}
}
impl TryFrom<&str> for MapId {
type Error = MapIdError;
fn try_from(s: &str) -> Result<Self, Self::Error> {
s.to_string().try_into()
}
}
impl Into<MapId> for Map {
fn into(self) -> MapId {
MapId::Hash(self.hash)
}
}
impl Into<MapId> for &Map {
fn into(self) -> MapId {
MapId::Hash(self.hash.clone())
}
}
#[derive(Debug)]
pub enum BeatSaverApiError<T: fmt::Display> {
RequestError(T),
SerializeError(serde_json::Error),
ArgumentError(&'static str),
Utf8Error(FromUtf8Error),
}
impl<T: fmt::Display> fmt::Display for BeatSaverApiError<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::RequestError(e) => <T as fmt::Display>::fmt(e, f),
Self::SerializeError(e) => e.fmt(f),
Self::ArgumentError(a) => write!(f, "Invalid argument: {}", a),
Self::Utf8Error(e) => e.fmt(f),
}
}
}
impl<T: fmt::Display> From<serde_json::Error> for BeatSaverApiError<T> {
fn from(e: serde_json::Error) -> Self {
Self::SerializeError(e)
}
}
impl<T: fmt::Display> From<FromUtf8Error> for BeatSaverApiError<T> {
fn from(e: FromUtf8Error) -> Self {
Self::Utf8Error(e)
}
}
#[cfg(feature = "async")]
#[async_trait]
pub trait BeatSaverApiAsync<'a, T: 'a + Error>
where
BeatSaverApiError<T>: From<T>,
{
async fn request_raw(&'a self, url: Url) -> Result<Bytes, T>;
async fn request(&'a self, url: Url) -> Result<String, BeatSaverApiError<T>> {
let data = self.request_raw(url).await?;
Ok(String::from_utf8(data.as_ref().to_vec())?)
}
async fn map(&'a self, id: &MapId) -> Result<Map, BeatSaverApiError<T>> {
let data = match id {
MapId::Key(k) => {
self.request(
BEATSAVER_URL
.join(format!("api/maps/detail/{:x}", k).as_str())
.unwrap(),
)
.await?
}
MapId::Hash(h) => {
self.request(
BEATSAVER_URL
.join(format!("api/maps/by-hash/{}", h).as_str())
.unwrap(),
)
.await?
}
};
Ok(serde_json::from_str(data.as_str())?)
}
async fn maps_by(&'a self, user: &BeatSaverUser) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self
.request(
BEATSAVER_URL
.join(format!("api/maps/uploader/{}", user.id).as_str())
.unwrap(),
)
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn maps_hot(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self
.request(BEATSAVER_URL.join("api/maps/hot").unwrap())
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn maps_rating(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self
.request(BEATSAVER_URL.join("api/maps/rating").unwrap())
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn maps_latest(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self
.request(BEATSAVER_URL.join("api/maps/latest").unwrap())
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn maps_downloads(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self
.request(BEATSAVER_URL.join("api/maps/downloads").unwrap())
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn maps_plays(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self
.request(BEATSAVER_URL.join("api/maps/plays").unwrap())
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn user(&'a self, id: String) -> Result<BeatSaverUser, BeatSaverApiError<T>> {
if id.len() != 24 || hex::decode(&id).is_err() {
return Err(BeatSaverApiError::ArgumentError("id"));
}
let data = self
.request(
BEATSAVER_URL
.join(format!("api/users/find/{}", id).as_str())
.unwrap(),
)
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn search(&'a self, query: String) -> Result<Page<Map>, BeatSaverApiError<T>> {
let query = encode(query.as_str());
let data = self
.request(
BEATSAVER_URL
.join(format!("api/search/text?q={}", query).as_str())
.unwrap(),
)
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn search_advanced(&'a self, query: String) -> Result<Page<Map>, BeatSaverApiError<T>> {
let query = encode(query.as_str());
let data = self
.request(
BEATSAVER_URL
.join(format!("api/search/advanced?q={}", query).as_str())
.unwrap(),
)
.await?;
Ok(serde_json::from_str(data.as_str())?)
}
async fn download(&'a self, id: MapId) -> Result<Bytes, BeatSaverApiError<T>> {
Ok(self
.request_raw(
BEATSAVER_URL
.join(
match id {
MapId::Key(k) => format!("api/download/key/{:x}", k),
MapId::Hash(h) => format!("api/download/hash/{}", h),
}
.as_str(),
)
.unwrap(),
)
.await?)
}
}
#[cfg(feature = "sync")]
pub trait BeatSaverApiSync<'a, T: 'a + Error>
where
BeatSaverApiError<T>: From<T>,
{
fn request_raw(&'a self, url: Url) -> Result<Bytes, T>;
fn request(&'a self, url: Url) -> Result<String, BeatSaverApiError<T>> {
let data = self.request_raw(url)?;
Ok(String::from_utf8(data.as_ref().to_vec())?)
}
fn map(&'a self, id: &MapId) -> Result<Map, BeatSaverApiError<T>> {
let data = match id {
MapId::Key(k) => self.request(
BEATSAVER_URL
.join(format!("api/maps/detail/{:x}", k).as_str())
.unwrap(),
)?,
MapId::Hash(h) => self.request(
BEATSAVER_URL
.join(format!("api/maps/by-hash/{}", h).as_str())
.unwrap(),
)?,
};
Ok(serde_json::from_str(data.as_str())?)
}
fn maps_by(&'a self, user: &BeatSaverUser) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self.request(
BEATSAVER_URL
.join(format!("api/maps/uploader/{}", user.id).as_str())
.unwrap(),
)?;
Ok(serde_json::from_str(data.as_str())?)
}
fn maps_hot(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self.request(BEATSAVER_URL.join("api/maps/hot").unwrap())?;
Ok(serde_json::from_str(data.as_str())?)
}
fn maps_rating(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self.request(BEATSAVER_URL.join("api/maps/rating").unwrap())?;
Ok(serde_json::from_str(data.as_str())?)
}
fn maps_latest(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self.request(BEATSAVER_URL.join("api/maps/latest").unwrap())?;
Ok(serde_json::from_str(data.as_str())?)
}
fn maps_downloads(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self.request(BEATSAVER_URL.join("api/maps/downloads").unwrap())?;
Ok(serde_json::from_str(data.as_str())?)
}
fn maps_plays(&'a self) -> Result<Page<Map>, BeatSaverApiError<T>> {
let data = self.request(BEATSAVER_URL.join("api/maps/plays").unwrap())?;
Ok(serde_json::from_str(data.as_str())?)
}
fn user(&'a self, id: String) -> Result<BeatSaverUser, BeatSaverApiError<T>> {
if id.len() != 24 || hex::decode(&id).is_err() {
return Err(BeatSaverApiError::ArgumentError("id"));
}
let data = self.request(
BEATSAVER_URL
.join(format!("api/users/find/{}", id).as_str())
.unwrap(),
)?;
Ok(serde_json::from_str(data.as_str())?)
}
fn search(&'a self, query: String) -> Result<Page<Map>, BeatSaverApiError<T>> {
let query = encode(query.as_str());
let data = self.request(
BEATSAVER_URL
.join(format!("api/search/text?q={}", query).as_str())
.unwrap(),
)?;
Ok(serde_json::from_str(data.as_str())?)
}
fn search_advanced(&'a self, query: String) -> Result<Page<Map>, BeatSaverApiError<T>> {
let query = encode(query.as_str());
let data = self.request(
BEATSAVER_URL
.join(format!("api/search/advanced?q={}", query).as_str())
.unwrap(),
)?;
Ok(serde_json::from_str(data.as_str())?)
}
fn download(&'a self, id: MapId) -> Result<Bytes, BeatSaverApiError<T>> {
Ok(self.request_raw(
BEATSAVER_URL
.join(
match id {
MapId::Key(k) => format!("api/download/key/{:x}", k),
MapId::Hash(h) => format!("api/download/hash/{}", h),
}
.as_str(),
)
.unwrap(),
)?)
}
}
#[cfg(all(feature = "async", not(feature = "sync")))]
pub use BeatSaverApiAsync as BeatSaverApi;
#[cfg(all(feature = "sync", not(feature = "async")))]
pub use BeatSaverApiSync as BeatSaverApi;
#[cfg(test)]
mod tests {
use crate::map::Map;
#[cfg(feature = "async")]
use crate::BeatSaverApiAsync;
#[cfg(feature = "sync")]
use crate::BeatSaverApiSync;
use crate::{BeatSaverApiError, Page};
#[cfg(feature = "async")]
use async_trait::async_trait;
use bytes::Bytes;
use std::error::Error;
use std::fmt::{self, Display, Formatter};
use url::Url;
#[derive(Debug)]
enum FakeError {}
impl Display for FakeError {
fn fmt(&self, _: &mut Formatter) -> fmt::Result {
Ok(())
}
}
impl Error for FakeError {}
impl From<FakeError> for BeatSaverApiError<FakeError> {
fn from(e: FakeError) -> Self {
Self::RequestError(e)
}
}
struct FakeClient {
url: Url,
data: Bytes,
}
impl FakeClient {
fn new(url: Url, data: Bytes) -> Self {
Self { url, data }
}
}
#[cfg(feature = "sync")]
impl<'a> BeatSaverApiSync<'a, FakeError> for FakeClient {
fn request_raw(&'a self, url: Url) -> Result<Bytes, FakeError> {
assert_eq!(self.url, url);
Ok(self.data.clone())
}
}
#[cfg(feature = "async")]
#[async_trait]
impl<'a> BeatSaverApiAsync<'a, FakeError> for FakeClient {
async fn request_raw(&'a self, url: Url) -> Result<Bytes, FakeError> {
assert_eq!(self.url, url);
Ok(self.data.clone())
}
}
#[test]
fn test_page() {
let data = r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":true},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":417,"length":195,"bombs":4,"notes":301,"obstacles":24,"njs":10,"njsOffset":0},"hard":{"duration":417,"length":195,"bombs":4,"notes":486,"obstacles":24,"njs":10,"njsOffset":0},"expert":{"duration":417.5,"length":195,"bombs":4,"notes":620,"obstacles":24,"njs":10,"njsOffset":0},"expertPlus":{"duration":417.5,"length":195,"bombs":0,"notes":894,"obstacles":0,"njs":12,"njsOffset":0}}}],"songName":"Shut Up and Dance","songSubName":"WALK THE MOON","songAuthorName":"BennyDaBeast","levelAuthorName":"bennydabeast","bpm":128},"stats":{"downloads":418854,"plays":558,"downVotes":133,"upVotes":10763,"heat":395.8225333,"rating":0.9580848467461356},"description":"Difficulties: Expert+ (Added 11/15), Expert, Hard, Normal\r\nYouTube Preview: https://youtu.be/x9hJbTlPQUY","deletedAt":null,"_id":"5cff621148229f7d88fc77c9","key":"2144","name":"Shut Up and Dance - WALK THE MOON","uploader":{"_id":"5cff0b7298cc5a672c84e98d","username":"bennydabeast"},"uploaded":"2018-11-21T01:27:00.000Z","hash":"89cf8bb07afb3c59ae7b5ac00337d62261c36fb4","directDownload":"/cdn/2144/89cf8bb07afb3c59ae7b5ac00337d62261c36fb4.zip","downloadURL":"/api/download/key/2144","coverURL":"/cdn/2144/89cf8bb07afb3c59ae7b5ac00337d62261c36fb4.png"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":623.3125,"length":214,"bombs":0,"notes":462,"obstacles":25,"njs":10,"njsOffset":0},"hard":{"duration":623.3125,"length":214,"bombs":0,"notes":639,"obstacles":40,"njs":10,"njsOffset":0},"expert":{"duration":623.3125,"length":214,"bombs":0,"notes":825,"obstacles":40,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Mr. Blue Sky","songSubName":"Electric Light Orchestra","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":174},"stats":{"downloads":924827,"plays":39426,"downVotes":482,"upVotes":22614,"heat":94.0164429,"rating":0.9558554197954805},"description":"Channel your inner Baby Groot. Normal, Hard, Expert\r\nSpecial thanks to BennydaBeast for his help on this track!","deletedAt":null,"_id":"5cff620d48229f7d88fc65f7","key":"570","name":"Mr. Blue Sky | Electric Light Orchestra","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-06-16T16:53:34.000Z","hash":"236173d5ba7dc379d480b9cb5fb6b4fa5abe77da","directDownload":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.zip","downloadURL":"/api/download/key/570","coverURL":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":476.7637634277344,"length":173,"bombs":52,"notes":722,"obstacles":28,"njs":14,"njsOffset":0},"expertPlus":null}}],"songName":"Caramelldansen (Speedcake Remix)","songSubName":"Caramell","songAuthorName":"Dack","levelAuthorName":"Dack","bpm":165},"stats":{"downloads":255909,"plays":0,"downVotes":247,"upVotes":13125,"heat":604.9830484,"rating":0.953954336380672},"description":"Preview: https://youtu.be/V5p0HOzunY0\n\n\nPatreon: https://www.patreon.com/Dack","deletedAt":null,"_id":"5cff621548229f7d88fc8904","key":"3cf5","name":"Caramelldansen","uploader":{"_id":"5cff0b7598cc5a672c852c6f","username":"dack"},"uploaded":"2019-03-09T22:54:54.000Z","hash":"cf5e32d6b7f30095f7198da5894139c92336cad7","directDownload":"/cdn/3cf5/cf5e32d6b7f30095f7198da5894139c92336cad7.zip","downloadURL":"/api/download/key/3cf5","coverURL":"/cdn/3cf5/cf5e32d6b7f30095f7198da5894139c92336cad7.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":475,"length":226,"bombs":0,"notes":620,"obstacles":10,"njs":10,"njsOffset":0},"expert":{"duration":475,"length":226,"bombs":0,"notes":738,"obstacles":11,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Feel Invincible","songSubName":"Skillet","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":126},"stats":{"downloads":264718,"plays":3479,"downVotes":90,"upVotes":7118,"heat":231.7496095,"rating":0.9538897573416698},"description":"Expert / Hard\r\nhttps://www.youtube.com/watch?v=nq-Qul4XxbE","deletedAt":null,"_id":"5cff620f48229f7d88fc6eba","key":"121f","name":"Skillet - Feel Invincible","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-08-27T16:47:05.000Z","hash":"2e9ab6e1fb8055649e241cade98b018926cc93a8","directDownload":"/cdn/121f/2e9ab6e1fb8055649e241cade98b018926cc93a8.zip","downloadURL":"/api/download/key/121f","coverURL":"/cdn/121f/2e9ab6e1fb8055649e241cade98b018926cc93a8.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":418,"length":200,"bombs":0,"notes":216,"obstacles":0,"njs":10,"njsOffset":0},"normal":{"duration":418,"length":200,"bombs":0,"notes":388,"obstacles":8,"njs":10,"njsOffset":0},"hard":{"duration":418,"length":200,"bombs":0,"notes":514,"obstacles":10,"njs":11,"njsOffset":0},"expert":{"duration":418,"length":200,"bombs":0,"notes":560,"obstacles":12,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Believer (100k ver.)","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":511866,"plays":9381,"downVotes":215,"upVotes":11898,"heat":379.8995099,"rating":0.9538005825373931},"description":"This is one of the 22 maps that were mapped for the 100k Contest where you can win over $7,000 in prizes. Go to https://bsaber.com/100k-contest/ to register!","deletedAt":null,"_id":"5cff621148229f7d88fc76ec","key":"1fef","name":"Imagine Dragons - Believer (100k ver.) | 100k Contest","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-11-12T17:53:58.000Z","hash":"9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390","directDownload":"/cdn/1fef/9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390.zip","downloadURL":"/api/download/key/1fef","coverURL":"/cdn/1fef/9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":501.19000244140625,"length":227,"bombs":0,"notes":671,"obstacles":16,"njs":10,"njsOffset":0},"expert":{"duration":501.19000244140625,"length":227,"bombs":0,"notes":831,"obstacles":16,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Daddy","songSubName":"PSY","songAuthorName":"Fafurion","levelAuthorName":"fafurion","bpm":132},"stats":{"downloads":249499,"plays":2330,"downVotes":122,"upVotes":8354,"heat":243.8938387,"rating":0.9537082538199915},"description":"Insanely fun dance map! Enjoy!\r\nSee the map in action (Expert): https://www.youtube.com/watch?v=cWz6flYGs20\r\n\r\nThank you to my playtesters:\r\nQTPop (https://www.twitch.tv/qtpop)\r\nDuoVR (https://www.twitch.tv/duovr)\r\nSourgurl (https://www.twitch.tv/sourgurl)\r\nRexxxzi (https://www.twitch.tv/rexxxzi)\r\nAshleyriott (https://www.twitch.tv/ashleyriott)\r\n\r\nDiscord: @Fufu#5452","deletedAt":null,"_id":"5cff620f48229f7d88fc6f6c","key":"133b","name":"Daddy - PSY","uploader":{"_id":"5cff0b7398cc5a672c84f945","username":"fafurion"},"uploaded":"2018-09-02T23:43:45.000Z","hash":"dc489921185f92dfecb9cb07b84fc556123bd134","directDownload":"/cdn/133b/dc489921185f92dfecb9cb07b84fc556123bd134.zip","downloadURL":"/api/download/key/133b","coverURL":"/cdn/133b/dc489921185f92dfecb9cb07b84fc556123bd134.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":523.625,"length":245,"bombs":0,"notes":633,"obstacles":13,"njs":10,"njsOffset":0},"expert":{"duration":523.5650024414062,"length":245,"bombs":0,"notes":880,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Uprising","songSubName":"Muse","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":128},"stats":{"downloads":455551,"plays":11598,"downVotes":163,"upVotes":9190,"heat":84.4191212,"rating":0.9517991988617799},"description":"Expert / Hard\r\nhttps://youtu.be/WpFUt3UNp7c","deletedAt":null,"_id":"5cff620d48229f7d88fc655e","key":"4c6","name":"Muse - Uprising","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-06-11T21:47:41.000Z","hash":"00e5671e594a6fe621c3605fcc5a0e4466ba6478","directDownload":"/cdn/4c6/00e5671e594a6fe621c3605fcc5a0e4466ba6478.zip","downloadURL":"/api/download/key/4c6","coverURL":"/cdn/4c6/00e5671e594a6fe621c3605fcc5a0e4466ba6478.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":true,"hard":false,"normal":false},"duration":0,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":547,"length":234,"njs":12,"njsOffset":0,"bombs":0,"notes":705,"obstacles":10},"expertPlus":{"duration":547,"length":234,"njs":16,"njsOffset":0,"bombs":0,"notes":876,"obstacles":10},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"KikaeAeon","songAuthorName":"League of Legends & Against The Current","songName":"Legends Never Die","songSubName":"","bpm":140},"stats":{"downloads":141233,"plays":0,"downVotes":86,"upVotes":6203,"heat":997.2528853,"rating":0.9513775893989509},"description":"A special request from Prima1URGE","deletedAt":null,"_id":"5d91d6c1871b1a0006f9b3e7","key":"66e6","name":"League of Legends - Legends never die (ft. Against The Current)","uploader":{"_id":"5cff0b7498cc5a672c85109b","username":"kikaeaeon"},"hash":"732bd4072b89d4b3bf0e63db812a7ffc3096e837","uploaded":"2019-09-30T10:19:45.606Z","directDownload":"/cdn/66e6/732bd4072b89d4b3bf0e63db812a7ffc3096e837.zip","downloadURL":"/api/download/key/66e6","coverURL":"/cdn/66e6/732bd4072b89d4b3bf0e63db812a7ffc3096e837.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":578,"length":194,"bombs":8,"notes":519,"obstacles":86,"njs":13,"njsOffset":0},"expert":{"duration":578,"length":194,"bombs":10,"notes":679,"obstacles":86,"njs":16,"njsOffset":0},"expertPlus":null}}],"songName":"Flamingo","songSubName":"Kero Kero Bonito","songAuthorName":"ETAN","levelAuthorName":"ETAN","bpm":178},"stats":{"downloads":141034,"plays":0,"downVotes":89,"upVotes":6307,"heat":744.9760285,"rating":0.9513314992226289},"description":"edited: NJS was a tad slow my b\r\nfuramingo \r\noh oh ooh oh\r\nthis needed to be remapped\r\n \r\nPlease check out Kero Kero Bonito and the rest of their songs\r\nI'll be mappin more of em soon\r\n\r\nBPM 178\r\nFlamingo (Expert)\r\nShrimp (Hard)\r\n\r\nhave fun \r\n\r\ngimme feedback on Discord\r\nETAN#8341","deletedAt":null,"_id":"5cff621748229f7d88fc93fc","key":"4e6f","name":"Kero Kero Bonito - Flamingo","uploader":{"_id":"5cff0b7798cc5a672c855775","username":"etan"},"uploaded":"2019-05-22T00:46:47.000Z","hash":"585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b","directDownload":"/cdn/4e6f/585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b.zip","downloadURL":"/api/download/key/4e6f","coverURL":"/cdn/4e6f/585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":689.8004760742188,"length":242,"bombs":16,"notes":1093,"obstacles":16,"njs":14,"njsOffset":0},"expertPlus":null}}],"songName":"IGNITE","songSubName":"Aoi Eir","songAuthorName":"Joetastic","levelAuthorName":"Joetastic","bpm":171},"stats":{"downloads":264817,"plays":0,"downVotes":141,"upVotes":7891,"heat":451.3583461,"rating":0.9502372997935349},"description":"Trying to get this version ranked! New version with changes according to the ranking criteria: Double directional notes fixed, flow improvements, removed fast dodge walls on bridge section.","deletedAt":null,"_id":"5cff621248229f7d88fc7b21","key":"26f6","name":"IGNITE (Ranked Version) [Sword Art Online Season 2 Opening] - Aoi Eir","uploader":{"_id":"5cff0b7498cc5a672c85050e","username":"joetastic"},"uploaded":"2018-12-20T01:21:47.000Z","hash":"125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c","directDownload":"/cdn/26f6/125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c.zip","downloadURL":"/api/download/key/26f6","coverURL":"/cdn/26f6/125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c.jpg"}],"totalDocs":35367,"lastPage":3536,"prevPage":null,"nextPage":1}"#;
let page: Page<Map> = serde_json::from_str(data).unwrap();
assert_eq!(page.docs.len(), 10);
assert_eq!(page.total_docs, 35367);
assert_eq!(page.last_page, 3536);
assert_eq!(page.prev_page, None);
assert_eq!(page.next_page, Some(1));
}
#[cfg(feature = "sync")]
mod sync_tests {
use crate::tests::FakeClient;
use crate::BEATSAVER_URL;
use crate::{BeatSaverApiSync, BeatSaverUser};
use std::convert::TryInto;
#[test]
fn test_map() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/detail/1").unwrap(), r#"{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}"#.into());
client.map(&"1".to_string().try_into().unwrap()).unwrap();
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/by-hash/fda568fc27c20d21f8dc6f3709b49b5cc96723be").unwrap(), r#"{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}"#.into());
client
.map(
&"fda568fc27c20d21f8dc6f3709b49b5cc96723be"
.to_string()
.try_into()
.unwrap(),
)
.unwrap();
}
#[test]
fn test_maps_by() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/uploader/5cff0b7298cc5a672c84e8a3").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40619,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21772,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273492,"plays":31684,"downVotes":177,"upVotes":4246,"heat":21.0822877,"rating":0.9232332918273986},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client
.maps_by(&BeatSaverUser {
id: "5cff0b7298cc5a672c84e8a3".to_string(),
username: "datkami".to_string(),
})
.unwrap();
}
#[test]
fn test_maps_hot() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/hot").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":false,"hard":false,"normal":false},"duration":13,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":13.625,"length":11,"njs":18,"njsOffset":1,"bombs":0,"notes":25,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Lawless"}],"levelAuthorName":"Chief Queef","songAuthorName":" ","songName":"*teleports behind you*","songSubName":"","bpm":69},"stats":{"downloads":494,"plays":0,"downVotes":0,"upVotes":10,"heat":1803.8752302,"rating":0.7570708845427101},"description":"nothing personnel kid","deletedAt":null,"_id":"5fbd9da95fd85f000691e895","key":"1146c","name":"*teleports behind you*","uploader":{"_id":"5f9a4d2a030219000627c2bf","username":"chief queef"},"hash":"4447287810e6ad338f379677c9d383b1634d876d","uploaded":"2020-11-24T23:56:25.360Z","directDownload":"/cdn/1146c/4447287810e6ad338f379677c9d383b1634d876d.zip","downloadURL":"/api/download/key/1146c","coverURL":"/cdn/1146c/4447287810e6ad338f379677c9d383b1634d876d.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":true,"hard":false,"normal":false},"duration":225,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":312.15301513671875,"length":208,"njs":16,"njsOffset":-0.4000000059604645,"bombs":12,"notes":551,"obstacles":194},"expertPlus":{"duration":312.15301513671875,"length":208,"njs":16,"njsOffset":-0.4000000059604645,"bombs":12,"notes":564,"obstacles":220},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"AmpereBEEP","songAuthorName":"Madeon","songName":"Home","songSubName":"","bpm":90},"stats":{"downloads":513,"plays":0,"downVotes":2,"upVotes":8,"heat":1803.5866947,"rating":0.6542425307256261},"description":"Really? No maps of this song before? That's a surprise.\r\n\r\nThis song is nice and slow and the map fits it accordingly. Could be good for accuracy practice or just a good map for newer players to see some good flow. \r\n\r\nMap comes with 2 difficulties: Expert+ with 564 notes at 2.50 notes per second, and a slightly less difficult Expert with 551 notes at 2.44 notes per second. Both maps are nearly identical, with the Expert+ difficulty having dodge walls and a section that might be a little difficult to read for new players.\r\n\r\nIf you have any feedback or any suggestions, send it to AmpereBEEP#1723 on Discord.","deletedAt":null,"_id":"5fbd91f000e48a00065a7826","key":"11467","name":"Home - Madeon","uploader":{"_id":"5ed1475c9ae7380006c6f245","username":"amperebeep"},"hash":"059a919433c73ebf299b32ec351b60adf50add89","uploaded":"2020-11-24T23:06:24.457Z","directDownload":"/cdn/11467/059a919433c73ebf299b32ec351b60adf50add89.zip","downloadURL":"/api/download/key/11467","coverURL":"/cdn/11467/059a919433c73ebf299b32ec351b60adf50add89.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":152,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":287.7916564941406,"length":150,"njs":18,"njsOffset":-0.30000001192092896,"bombs":0,"notes":763,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"EPG7ENS","songAuthorName":"MACROSS 82-99","songName":"89.22 FM","songSubName":"","bpm":115},"stats":{"downloads":680,"plays":0,"downVotes":0,"upVotes":9,"heat":1803.4551916,"rating":0.75},"description":"i'm kinda into japanese city pop rn\nenjoy ;)","deletedAt":null,"_id":"5fbd5bde5fd85f00069186b4","key":"11435","name":"82.99 MACROSS 82-99","uploader":{"_id":"5cff0b7798cc5a672c855bb6","username":"epg7ens"},"hash":"7555522308b9ed339a03ea574dd0b298d323349f","uploaded":"2020-11-24T19:15:42.711Z","directDownload":"/cdn/11435/7555522308b9ed339a03ea574dd0b298d323349f.zip","downloadURL":"/api/download/key/11435","coverURL":"/cdn/11435/7555522308b9ed339a03ea574dd0b298d323349f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":317,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":904.8702392578125,"length":313,"njs":20,"njsOffset":-0.3199999928474426,"bombs":0,"notes":1914,"obstacles":116},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"EOP Glacier","songAuthorName":"Hatsuki Yura","songName":"Drivi'n Greedy","songSubName":"Nhato Remix","bpm":173},"stats":{"downloads":330,"plays":0,"downVotes":0,"upVotes":3,"heat":1803.443705,"rating":0.6705937099936721},"description":"This has been in my WIP folder for months but it's finally finished\n\nSong Stats:\nTop/Middle/Bottom Split:\n10%/32%/57%\nNPS: 6.02\nLights: 4,191","deletedAt":null,"_id":"5fbdadb8e3a5a20006f981d6","key":"11482","name":"Hatsuki Yura - Drivi'n Greedy","uploader":{"_id":"5d50e360adb1a20006305ca0","username":"eop glacier"},"hash":"2d000f27e4bf8a591f16cdd5322279186492b3ea","uploaded":"2020-11-25T01:04:56.269Z","directDownload":"/cdn/11482/2d000f27e4bf8a591f16cdd5322279186492b3ea.zip","downloadURL":"/api/download/key/11482","coverURL":"/cdn/11482/2d000f27e4bf8a591f16cdd5322279186492b3ea.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":110,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":174.537,"length":58,"njs":23,"njsOffset":-0.5,"bombs":6,"notes":333,"obstacles":46},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Astrella","songAuthorName":"Breakmaster Cylinder","songName":"The Most Gangster Drop","songSubName":"","bpm":180},"stats":{"downloads":16,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3840344,"rating":0},"description":"gangster awehfiuawefluiawehfaiuwhfewaf","deletedAt":null,"_id":"5fbdf719ea68e70007b21333","key":"1149e","name":"The Most Gangster Drop - Breakmaster Cylinder","uploader":{"_id":"5fa1e74381e1d70006f2cc01","username":"c0r3nn"},"hash":"d6a267ea3d6a0d715d1d320e7773ad646aa2a424","uploaded":"2020-11-25T06:18:01.546Z","directDownload":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.zip","downloadURL":"/api/download/key/1149e","coverURL":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":239,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":243.375,"length":101,"njs":12,"njsOffset":0,"bombs":0,"notes":300,"obstacles":2},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Packz","songAuthorName":"Illenium, John Bellion","songName":"Good Things Fall Apart - Illenium, John Bellion","songSubName":"","bpm":144},"stats":{"downloads":74,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3043823,"rating":0},"description":"this is a test map dont download","deletedAt":null,"_id":"5fbde91900e48a00065ae757","key":"1149d","name":"tyui","uploader":{"_id":"5f9a3ba76ef6a20006d59aea","username":"milla"},"hash":"eb7f40e59ee44be638054b3ca41f4f4b7b5b357f","uploaded":"2020-11-25T05:18:17.204Z","directDownload":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.zip","downloadURL":"/api/download/key/1149d","coverURL":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":254,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":567.219970703125,"length":243,"njs":21,"njsOffset":0.20000000298023224,"bombs":0,"notes":1253,"obstacles":7},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"night","songAuthorName":"Coheed and Cambria","songName":"Unheavenly Creatures","songSubName":"","bpm":140},"stats":{"downloads":409,"plays":0,"downVotes":0,"upVotes":3,"heat":1803.2977382,"rating":0.6705937099936721},"description":"Had fun mapping this one :)\nSend Feedback on Discord: night#0101","deletedAt":null,"_id":"5fbd940f9107590006129976","key":"1146a","name":"Coheed and Cambria - Unheavenly Creatures","uploader":{"_id":"5e244b8c003ea300067e67eb","username":"night"},"hash":"708d4a5c44c45a57d636b21c531cddde71674302","uploaded":"2020-11-24T23:15:27.762Z","directDownload":"/cdn/1146a/708d4a5c44c45a57d636b21c531cddde71674302.zip","downloadURL":"/api/download/key/1146a","coverURL":"/cdn/1146a/708d4a5c44c45a57d636b21c531cddde71674302.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":74,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":399,"length":106,"njs":23,"njsOffset":-0.20000000298023224,"bombs":0,"notes":931,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"DE125","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix) (Literally Just the First Drop Ver.)","bpm":225},"stats":{"downloads":85,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2910497,"rating":0},"description":"Literally just the first drop.\nI overmapped this so the pattern would work B)\n\nDm with issues @DE125#0001 if the issue isn't cringe saut burnt rice pattern","deletedAt":null,"_id":"5fbde6c1ea68e70007b20165","key":"1149c","name":"you - Melancholia (EKU's Desolation Remix) (TV Size)","uploader":{"_id":"5cff0b7798cc5a672c8554ba","username":"de125"},"hash":"2cb3a27602b362a6265fdfd543f4eec31f957ba4","uploaded":"2020-11-25T05:08:17.236Z","directDownload":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.zip","downloadURL":"/api/download/key/1149c","coverURL":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":false,"hard":false,"normal":false},"duration":6,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":15.5,"length":5,"njs":18,"njsOffset":0,"bombs":0,"notes":6,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Reddek","songAuthorName":"G","songName":"I like your cock G","songSubName":"","bpm":157.1999969482422},"stats":{"downloads":585,"plays":0,"downVotes":0,"upVotes":5,"heat":1803.273026,"rating":0.7084432256108616},"description":"why not","deletedAt":null,"_id":"5fbd68b800e48a00065a3663","key":"11445","name":"I like your cock G","uploader":{"_id":"5dbfb4426dea0b0006bd328d","username":"reddek"},"hash":"d3be6bc67cda1f13b3ac91c6b98d90605153f7f9","uploaded":"2020-11-24T20:10:32.522Z","directDownload":"/cdn/11445/d3be6bc67cda1f13b3ac91c6b98d90605153f7f9.zip","downloadURL":"/api/download/key/11445","coverURL":"/cdn/11445/d3be6bc67cda1f13b3ac91c6b98d90605153f7f9.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":true,"expertPlus":false,"hard":true,"normal":true},"duration":96,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":269.302083,"length":89,"njs":8,"njsOffset":0,"bombs":0,"notes":179,"obstacles":18},"expert":{"duration":269.302083,"length":89,"njs":15,"njsOffset":0,"bombs":14,"notes":403,"obstacles":112},"expertPlus":null,"hard":{"duration":269.302083,"length":89,"njs":13,"njsOffset":0,"bombs":11,"notes":360,"obstacles":102},"normal":{"duration":269.302083,"length":89,"njs":10,"njsOffset":0,"bombs":20,"notes":286,"obstacles":30}},"name":"Standard"}],"levelAuthorName":"rodysan","songAuthorName":"Ryu*","songName":"Sakura Sunrise","songSubName":"","bpm":181},"stats":{"downloads":91,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2705277,"rating":0},"description":"9","deletedAt":null,"_id":"5fbde325ea68e70007b1fd1e","key":"1149b","name":"Sakura Sunrise - Ryu☆","uploader":{"_id":"5fabfd44fe23c6000688154a","username":"rodysan"},"hash":"eea9c9813c1a06ce2ea754a4d4557f98bdc33d33","uploaded":"2020-11-25T04:52:53.745Z","directDownload":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.zip","downloadURL":"/api/download/key/1149b","coverURL":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.png"}],"totalDocs":35532,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_hot().unwrap();
}
#[test]
fn test_maps_rating() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/rating").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":true},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":417,"length":195,"bombs":4,"notes":301,"obstacles":24,"njs":10,"njsOffset":0},"hard":{"duration":417,"length":195,"bombs":4,"notes":486,"obstacles":24,"njs":10,"njsOffset":0},"expert":{"duration":417.5,"length":195,"bombs":4,"notes":620,"obstacles":24,"njs":10,"njsOffset":0},"expertPlus":{"duration":417.5,"length":195,"bombs":0,"notes":894,"obstacles":0,"njs":12,"njsOffset":0}}}],"songName":"Shut Up and Dance","songSubName":"WALK THE MOON","songAuthorName":"BennyDaBeast","levelAuthorName":"bennydabeast","bpm":128},"stats":{"downloads":422048,"plays":558,"downVotes":136,"upVotes":10824,"heat":395.8248964,"rating":0.9579470354714587},"description":"Difficulties: Expert+ (Added 11/15), Expert, Hard, Normal\r\nYouTube Preview: https://youtu.be/x9hJbTlPQUY","deletedAt":null,"_id":"5cff621148229f7d88fc77c9","key":"2144","name":"Shut Up and Dance - WALK THE MOON","uploader":{"_id":"5cff0b7298cc5a672c84e98d","username":"bennydabeast"},"uploaded":"2018-11-21T01:27:00.000Z","hash":"89cf8bb07afb3c59ae7b5ac00337d62261c36fb4","directDownload":"/cdn/2144/89cf8bb07afb3c59ae7b5ac00337d62261c36fb4.zip","downloadURL":"/api/download/key/2144","coverURL":"/cdn/2144/89cf8bb07afb3c59ae7b5ac00337d62261c36fb4.png"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":623.3125,"length":214,"bombs":0,"notes":462,"obstacles":25,"njs":10,"njsOffset":0},"hard":{"duration":623.3125,"length":214,"bombs":0,"notes":639,"obstacles":40,"njs":10,"njsOffset":0},"expert":{"duration":623.3125,"length":214,"bombs":0,"notes":825,"obstacles":40,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Mr. Blue Sky","songSubName":"Electric Light Orchestra","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":174},"stats":{"downloads":929036,"plays":39426,"downVotes":485,"upVotes":22691,"heat":94.0178926,"rating":0.9558250129688451},"description":"Channel your inner Baby Groot. Normal, Hard, Expert\r\nSpecial thanks to BennydaBeast for his help on this track!","deletedAt":null,"_id":"5cff620d48229f7d88fc65f7","key":"570","name":"Mr. Blue Sky | Electric Light Orchestra","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-06-16T16:53:34.000Z","hash":"236173d5ba7dc379d480b9cb5fb6b4fa5abe77da","directDownload":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.zip","downloadURL":"/api/download/key/570","coverURL":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":475,"length":226,"bombs":0,"notes":620,"obstacles":10,"njs":10,"njsOffset":0},"expert":{"duration":475,"length":226,"bombs":0,"notes":738,"obstacles":11,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Feel Invincible","songSubName":"Skillet","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":126},"stats":{"downloads":266051,"plays":3479,"downVotes":90,"upVotes":7150,"heat":231.7515825,"rating":0.9539859440299348},"description":"Expert / Hard\r\nhttps://www.youtube.com/watch?v=nq-Qul4XxbE","deletedAt":null,"_id":"5cff620f48229f7d88fc6eba","key":"121f","name":"Skillet - Feel Invincible","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-08-27T16:47:05.000Z","hash":"2e9ab6e1fb8055649e241cade98b018926cc93a8","directDownload":"/cdn/121f/2e9ab6e1fb8055649e241cade98b018926cc93a8.zip","downloadURL":"/api/download/key/121f","coverURL":"/cdn/121f/2e9ab6e1fb8055649e241cade98b018926cc93a8.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":476.7637634277344,"length":173,"bombs":52,"notes":722,"obstacles":28,"njs":14,"njsOffset":0},"expertPlus":null}}],"songName":"Caramelldansen (Speedcake Remix)","songSubName":"Caramell","songAuthorName":"Dack","levelAuthorName":"Dack","bpm":165},"stats":{"downloads":257793,"plays":0,"downVotes":249,"upVotes":13203,"heat":604.9856039,"rating":0.9539671938016036},"description":"Preview: https://youtu.be/V5p0HOzunY0\n\n\nPatreon: https://www.patreon.com/Dack","deletedAt":null,"_id":"5cff621548229f7d88fc8904","key":"3cf5","name":"Caramelldansen","uploader":{"_id":"5cff0b7598cc5a672c852c6f","username":"dack"},"uploaded":"2019-03-09T22:54:54.000Z","hash":"cf5e32d6b7f30095f7198da5894139c92336cad7","directDownload":"/cdn/3cf5/cf5e32d6b7f30095f7198da5894139c92336cad7.zip","downloadURL":"/api/download/key/3cf5","coverURL":"/cdn/3cf5/cf5e32d6b7f30095f7198da5894139c92336cad7.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":418,"length":200,"bombs":0,"notes":216,"obstacles":0,"njs":10,"njsOffset":0},"normal":{"duration":418,"length":200,"bombs":0,"notes":388,"obstacles":8,"njs":10,"njsOffset":0},"hard":{"duration":418,"length":200,"bombs":0,"notes":514,"obstacles":10,"njs":11,"njsOffset":0},"expert":{"duration":418,"length":200,"bombs":0,"notes":560,"obstacles":12,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Believer (100k ver.)","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":514839,"plays":9381,"downVotes":217,"upVotes":11958,"heat":379.9016606,"rating":0.953774738159888},"description":"This is one of the 22 maps that were mapped for the 100k Contest where you can win over $7,000 in prizes. Go to https://bsaber.com/100k-contest/ to register!","deletedAt":null,"_id":"5cff621148229f7d88fc76ec","key":"1fef","name":"Imagine Dragons - Believer (100k ver.) | 100k Contest","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-11-12T17:53:58.000Z","hash":"9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390","directDownload":"/cdn/1fef/9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390.zip","downloadURL":"/api/download/key/1fef","coverURL":"/cdn/1fef/9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":501.19000244140625,"length":227,"bombs":0,"notes":671,"obstacles":16,"njs":10,"njsOffset":0},"expert":{"duration":501.19000244140625,"length":227,"bombs":0,"notes":831,"obstacles":16,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Daddy","songSubName":"PSY","songAuthorName":"Fafurion","levelAuthorName":"fafurion","bpm":132},"stats":{"downloads":251102,"plays":2330,"downVotes":123,"upVotes":8386,"heat":243.8954711,"rating":0.953687887575571},"description":"Insanely fun dance map! Enjoy!\r\nSee the map in action (Expert): https://www.youtube.com/watch?v=cWz6flYGs20\r\n\r\nThank you to my playtesters:\r\nQTPop (https://www.twitch.tv/qtpop)\r\nDuoVR (https://www.twitch.tv/duovr)\r\nSourgurl (https://www.twitch.tv/sourgurl)\r\nRexxxzi (https://www.twitch.tv/rexxxzi)\r\nAshleyriott (https://www.twitch.tv/ashleyriott)\r\n\r\nDiscord: @Fufu#5452","deletedAt":null,"_id":"5cff620f48229f7d88fc6f6c","key":"133b","name":"Daddy - PSY","uploader":{"_id":"5cff0b7398cc5a672c84f945","username":"fafurion"},"uploaded":"2018-09-02T23:43:45.000Z","hash":"dc489921185f92dfecb9cb07b84fc556123bd134","directDownload":"/cdn/133b/dc489921185f92dfecb9cb07b84fc556123bd134.zip","downloadURL":"/api/download/key/133b","coverURL":"/cdn/133b/dc489921185f92dfecb9cb07b84fc556123bd134.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":523.625,"length":245,"bombs":0,"notes":633,"obstacles":13,"njs":10,"njsOffset":0},"expert":{"duration":523.5650024414062,"length":245,"bombs":0,"notes":880,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Uprising","songSubName":"Muse","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":128},"stats":{"downloads":458225,"plays":11598,"downVotes":163,"upVotes":9224,"heat":84.4207539,"rating":0.9518918933740727},"description":"Expert / Hard\r\nhttps://youtu.be/WpFUt3UNp7c","deletedAt":null,"_id":"5cff620d48229f7d88fc655e","key":"4c6","name":"Muse - Uprising","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-06-11T21:47:41.000Z","hash":"00e5671e594a6fe621c3605fcc5a0e4466ba6478","directDownload":"/cdn/4c6/00e5671e594a6fe621c3605fcc5a0e4466ba6478.zip","downloadURL":"/api/download/key/4c6","coverURL":"/cdn/4c6/00e5671e594a6fe621c3605fcc5a0e4466ba6478.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":true,"hard":false,"normal":false},"duration":0,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":547,"length":234,"njs":12,"njsOffset":0,"bombs":0,"notes":705,"obstacles":10},"expertPlus":{"duration":547,"length":234,"njs":16,"njsOffset":0,"bombs":0,"notes":876,"obstacles":10},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"KikaeAeon","songAuthorName":"League of Legends & Against The Current","songName":"Legends Never Die","songSubName":"","bpm":140},"stats":{"downloads":142656,"plays":0,"downVotes":87,"upVotes":6241,"heat":997.2555043,"rating":0.9513740970623574},"description":"A special request from Prima1URGE","deletedAt":null,"_id":"5d91d6c1871b1a0006f9b3e7","key":"66e6","name":"League of Legends - Legends never die (ft. Against The Current)","uploader":{"_id":"5cff0b7498cc5a672c85109b","username":"kikaeaeon"},"hash":"732bd4072b89d4b3bf0e63db812a7ffc3096e837","uploaded":"2019-09-30T10:19:45.606Z","directDownload":"/cdn/66e6/732bd4072b89d4b3bf0e63db812a7ffc3096e837.zip","downloadURL":"/api/download/key/66e6","coverURL":"/cdn/66e6/732bd4072b89d4b3bf0e63db812a7ffc3096e837.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":578,"length":194,"bombs":8,"notes":519,"obstacles":86,"njs":13,"njsOffset":0},"expert":{"duration":578,"length":194,"bombs":10,"notes":679,"obstacles":86,"njs":16,"njsOffset":0},"expertPlus":null}}],"songName":"Flamingo","songSubName":"Kero Kero Bonito","songAuthorName":"ETAN","levelAuthorName":"ETAN","bpm":178},"stats":{"downloads":142323,"plays":0,"downVotes":90,"upVotes":6344,"heat":744.9785357,"rating":0.9513253928566593},"description":"edited: NJS was a tad slow my b\r\nfuramingo \r\noh oh ooh oh\r\nthis needed to be remapped\r\n \r\nPlease check out Kero Kero Bonito and the rest of their songs\r\nI'll be mappin more of em soon\r\n\r\nBPM 178\r\nFlamingo (Expert)\r\nShrimp (Hard)\r\n\r\nhave fun \r\n\r\ngimme feedback on Discord\r\nETAN#8341","deletedAt":null,"_id":"5cff621748229f7d88fc93fc","key":"4e6f","name":"Kero Kero Bonito - Flamingo","uploader":{"_id":"5cff0b7798cc5a672c855775","username":"etan"},"uploaded":"2019-05-22T00:46:47.000Z","hash":"585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b","directDownload":"/cdn/4e6f/585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b.zip","downloadURL":"/api/download/key/4e6f","coverURL":"/cdn/4e6f/585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":689.8004760742188,"length":242,"bombs":16,"notes":1093,"obstacles":16,"njs":14,"njsOffset":0},"expertPlus":null}}],"songName":"IGNITE","songSubName":"Aoi Eir","songAuthorName":"Joetastic","levelAuthorName":"Joetastic","bpm":171},"stats":{"downloads":266468,"plays":0,"downVotes":141,"upVotes":7933,"heat":451.3606934,"rating":0.9503730517090982},"description":"Trying to get this version ranked! New version with changes according to the ranking criteria: Double directional notes fixed, flow improvements, removed fast dodge walls on bridge section.","deletedAt":null,"_id":"5cff621248229f7d88fc7b21","key":"26f6","name":"IGNITE (Ranked Version) [Sword Art Online Season 2 Opening] - Aoi Eir","uploader":{"_id":"5cff0b7498cc5a672c85050e","username":"joetastic"},"uploaded":"2018-12-20T01:21:47.000Z","hash":"125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c","directDownload":"/cdn/26f6/125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c.zip","downloadURL":"/api/download/key/26f6","coverURL":"/cdn/26f6/125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_rating().unwrap();
}
#[test]
fn test_maps_latest() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/latest").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":225,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":512,"length":219,"njs":20,"njsOffset":-0.550000011920929,"bombs":101,"notes":688,"obstacles":35},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"AuroraModz","songAuthorName":"Cafe Disko","songName":"So High","songSubName":"(feat. Danél)","bpm":140},"stats":{"downloads":0,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.4047171,"rating":0},"description":"Mapped By UwUCrew.\nWe are a various mapping team that makes songs based on what the community wants. If you would like to request a song join this discord>https://discord.gg/YueyEWb\n","deletedAt":null,"_id":"5fbdfabcea68e70007b216f6","key":"1149f","name":"Cafe Disko - So High (feat. Danél)","uploader":{"_id":"5f292e68c9b14c0006ce923f","username":"uwucrew"},"hash":"56941d85c66142fb91aaa62eeb36e65262343d9a","uploaded":"2020-11-25T06:33:32.268Z","directDownload":"/cdn/1149f/56941d85c66142fb91aaa62eeb36e65262343d9a.zip","downloadURL":"/api/download/key/1149f","coverURL":"/cdn/1149f/56941d85c66142fb91aaa62eeb36e65262343d9a.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":110,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":174.537,"length":58,"njs":23,"njsOffset":-0.5,"bombs":6,"notes":333,"obstacles":46},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Astrella","songAuthorName":"Breakmaster Cylinder","songName":"The Most Gangster Drop","songSubName":"","bpm":180},"stats":{"downloads":21,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3840344,"rating":0},"description":"gangster awehfiuawefluiawehfaiuwhfewaf","deletedAt":null,"_id":"5fbdf719ea68e70007b21333","key":"1149e","name":"The Most Gangster Drop - Breakmaster Cylinder","uploader":{"_id":"5fa1e74381e1d70006f2cc01","username":"c0r3nn"},"hash":"d6a267ea3d6a0d715d1d320e7773ad646aa2a424","uploaded":"2020-11-25T06:18:01.546Z","directDownload":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.zip","downloadURL":"/api/download/key/1149e","coverURL":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":239,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":243.375,"length":101,"njs":12,"njsOffset":0,"bombs":0,"notes":300,"obstacles":2},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Packz","songAuthorName":"Illenium, John Bellion","songName":"Good Things Fall Apart - Illenium, John Bellion","songSubName":"","bpm":144},"stats":{"downloads":77,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3043823,"rating":0},"description":"this is a test map dont download","deletedAt":null,"_id":"5fbde91900e48a00065ae757","key":"1149d","name":"tyui","uploader":{"_id":"5f9a3ba76ef6a20006d59aea","username":"milla"},"hash":"eb7f40e59ee44be638054b3ca41f4f4b7b5b357f","uploaded":"2020-11-25T05:18:17.204Z","directDownload":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.zip","downloadURL":"/api/download/key/1149d","coverURL":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":74,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":399,"length":106,"njs":23,"njsOffset":-0.20000000298023224,"bombs":0,"notes":931,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"DE125","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix) (Literally Just the First Drop Ver.)","bpm":225},"stats":{"downloads":91,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2910497,"rating":0},"description":"Literally just the first drop.\nI overmapped this so the pattern would work B)\n\nDm with issues @DE125#0001 if the issue isn't cringe saut burnt rice pattern","deletedAt":null,"_id":"5fbde6c1ea68e70007b20165","key":"1149c","name":"you - Melancholia (EKU's Desolation Remix) (TV Size)","uploader":{"_id":"5cff0b7798cc5a672c8554ba","username":"de125"},"hash":"2cb3a27602b362a6265fdfd543f4eec31f957ba4","uploaded":"2020-11-25T05:08:17.236Z","directDownload":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.zip","downloadURL":"/api/download/key/1149c","coverURL":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":true,"expertPlus":false,"hard":true,"normal":true},"duration":96,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":269.302083,"length":89,"njs":8,"njsOffset":0,"bombs":0,"notes":179,"obstacles":18},"expert":{"duration":269.302083,"length":89,"njs":15,"njsOffset":0,"bombs":14,"notes":403,"obstacles":112},"expertPlus":null,"hard":{"duration":269.302083,"length":89,"njs":13,"njsOffset":0,"bombs":11,"notes":360,"obstacles":102},"normal":{"duration":269.302083,"length":89,"njs":10,"njsOffset":0,"bombs":20,"notes":286,"obstacles":30}},"name":"Standard"}],"levelAuthorName":"rodysan","songAuthorName":"Ryu*","songName":"Sakura Sunrise","songSubName":"","bpm":181},"stats":{"downloads":96,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2705277,"rating":0},"description":"9","deletedAt":null,"_id":"5fbde325ea68e70007b1fd1e","key":"1149b","name":"Sakura Sunrise - Ryu☆","uploader":{"_id":"5fabfd44fe23c6000688154a","username":"rodysan"},"hash":"eea9c9813c1a06ce2ea754a4d4557f98bdc33d33","uploaded":"2020-11-25T04:52:53.745Z","directDownload":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.zip","downloadURL":"/api/download/key/1149b","coverURL":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.png"},{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":240,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":525.5,"length":233,"njs":12,"njsOffset":0,"bombs":235,"notes":1036,"obstacles":46},"hard":null,"normal":null},"name":"Standard"},{"difficulties":{"easy":{"duration":0,"length":0,"njs":16,"njsOffset":0,"bombs":0,"notes":0,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Lightshow"}],"levelAuthorName":"jd gamer65","songAuthorName":"CG5, Pokimane, TheRandomMusicMan, ect","songName":"A Killer on the floor","songSubName":"Among Us Rap Battle","bpm":135},"stats":{"downloads":116,"plays":0,"downVotes":1,"upVotes":1,"heat":1803.2316104,"rating":0.5},"description":"Made with the help of beatsage.com It is a bit choppy at bits, because i am a amateur editor. Hope you enjoy my first song I fully mapped! BTW there is a light show mode in case you wanna watch my dynamic lighting.","deletedAt":null,"_id":"5fbddc4ee3a5a20006f9bfb0","key":"11493","name":"Killer on the Floor, Among Us Rap Battle ","uploader":{"_id":"5f03f3fb8f03870006ab590f","username":"jd gamer65"},"hash":"6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26","uploaded":"2020-11-25T04:23:42.467Z","directDownload":"/cdn/11493/6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26.zip","downloadURL":"/api/download/key/11493","coverURL":"/cdn/11493/6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":49,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":203.5,"length":46,"njs":26,"njsOffset":-0.05000000074505806,"bombs":121,"notes":506,"obstacles":5},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"MonsterWook regrets this","songAuthorName":"Nickelodeon","songName":"FanBoy & ChumChum Theme Song","songSubName":"","bpm":260.0740051269531},"stats":{"downloads":112,"plays":0,"downVotes":0,"upVotes":1,"heat":1803.2228074,"rating":0.5941636475090435},"description":"BA BAB ABA ABA BA AB ABA BA BA ABB A ABA A BA BAB ABABAB ABB BRAIN FREEEZEEEEEE BABA BBBABABABBABABAB","deletedAt":null,"_id":"5fbddac2ea68e70007b1f529","key":"11492","name":"yes hahaha - FanBoy & ChumChum Theme Song","uploader":{"_id":"5e3e058b470a82000675dc55","username":"monsterwook2"},"hash":"b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb","uploaded":"2020-11-25T04:17:06.334Z","directDownload":"/cdn/11492/b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb.zip","downloadURL":"/api/download/key/11492","coverURL":"/cdn/11492/b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":false,"hard":true,"normal":true},"duration":235,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":null,"hard":{"duration":388,"length":232,"njs":14,"njsOffset":0,"bombs":0,"notes":874,"obstacles":9},"normal":{"duration":381.25,"length":228,"njs":12,"njsOffset":0,"bombs":60,"notes":374,"obstacles":52}},"name":"Standard"}],"levelAuthorName":"Alekcake","songAuthorName":"Amerie","songName":"1 Thing","songSubName":"","bpm":100},"stats":{"downloads":103,"plays":0,"downVotes":0,"upVotes":1,"heat":1803.2192485,"rating":0.5941636475090435},"description":"Special request :D\r\n\r\nGet in touch with us on our discord server!\r\nAlekcake's Kpop & VR Arcade - https://discord.gg/P4eGh26","deletedAt":null,"_id":"5fbdda22910759000612f575","key":"11490","name":"Amerie - 1 Thing","uploader":{"_id":"5ee6cc499ae7380006da7aef","username":"alekcake"},"hash":"5e4f00d81ef0363439c712c64f35dfea017918f9","uploaded":"2020-11-25T04:14:26.181Z","directDownload":"/cdn/11490/5e4f00d81ef0363439c712c64f35dfea017918f9.zip","downloadURL":"/api/download/key/11490","coverURL":"/cdn/11490/5e4f00d81ef0363439c712c64f35dfea017918f9.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":191,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":316,"length":184,"njs":18,"njsOffset":1,"bombs":0,"notes":935,"obstacles":94},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"MisterZ did it","songAuthorName":"LINKIN PARK","songName":"Pushing Me Away","songSubName":"","bpm":103},"stats":{"downloads":112,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.203822,"rating":0},"description":"","deletedAt":null,"_id":"5fbdd76b5fd85f00069233d5","key":"1148e","name":"Pushing Me Away","uploader":{"_id":"5f52d68f9824150006c5a23b","username":"misterz did it"},"hash":"fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2","uploaded":"2020-11-25T04:02:51.989Z","directDownload":"/cdn/1148e/fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2.zip","downloadURL":"/api/download/key/1148e","coverURL":"/cdn/1148e/fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":350,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":1264.1478271484375,"length":337,"njs":22,"njsOffset":-0.28999999165534973,"bombs":9,"notes":2553,"obstacles":250},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"abcbadq","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix)","bpm":225},"stats":{"downloads":122,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.1947261,"rating":0},"description":"crow walls thats all you need to know\nrequested by saints","deletedAt":null,"_id":"5fbdd5d239a7430006a0485d","key":"1148c","name":"Melancholia (EKU's Desolation Remix)","uploader":{"_id":"5e0344ebe85d6800061edc97","username":"abcbadq"},"hash":"94e516fab1650261b372ee83f51a9fe5fa6b2908","uploaded":"2020-11-25T03:56:02.673Z","directDownload":"/cdn/1148c/94e516fab1650261b372ee83f51a9fe5fa6b2908.zip","downloadURL":"/api/download/key/1148c","coverURL":"/cdn/1148c/94e516fab1650261b372ee83f51a9fe5fa6b2908.png"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_latest().unwrap();
}
#[test]
fn test_maps_downloads() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/downloads").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":468,"length":212,"bombs":4,"notes":415,"obstacles":42,"njs":10,"njsOffset":0},"hard":{"duration":468,"length":212,"bombs":40,"notes":695,"obstacles":94,"njs":10,"njsOffset":0},"expert":{"duration":468,"length":212,"bombs":50,"notes":932,"obstacles":103,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Gangnam Style","songSubName":"PSY","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":132},"stats":{"downloads":1069206,"plays":82700,"downVotes":617,"upVotes":17445,"heat":41.5047436,"rating":0.94147214608232},"description":"Expert, Hard, and Normal tracks. I tried my best to setup the chorus charts to allow you to mimic the classic dance moves. I think it matches up quite nicely. I hope you have as much fun playing as I did making this! Enjoy!","deletedAt":null,"_id":"5cff620c48229f7d88fc620d","key":"141","name":"GANGNAM STYLE","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-05-20T09:59:02.000Z","hash":"8e7e553099436af31564adf1977a5ec42a61cfff","directDownload":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.zip","downloadURL":"/api/download/key/141","coverURL":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":418,"length":200,"bombs":0,"notes":546,"obstacles":10,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Believer","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":1045930,"plays":70725,"downVotes":352,"upVotes":9390,"heat":18.911539,"rating":0.9346479331024395},"description":"Currently expert only. Events included.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e9","key":"b","name":"Imagine Dragons - Believer","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-05-08T18:56:36.000Z","hash":"19f2879d11a91b51a5c090d63471c3e8d9b7aee3","directDownload":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.zip","downloadURL":"/api/download/key/b","coverURL":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":328.556396484375,"length":142,"bombs":0,"notes":188,"obstacles":84,"njs":10,"njsOffset":0},"normal":{"duration":328.681396484375,"length":142,"bombs":40,"notes":219,"obstacles":70,"njs":10,"njsOffset":0},"hard":{"duration":328.681396484375,"length":142,"bombs":42,"notes":386,"obstacles":72,"njs":10,"njsOffset":0},"expert":{"duration":328.681396484375,"length":142,"bombs":46,"notes":623,"obstacles":69,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Beat it","songSubName":"Michael Jackson","songAuthorName":"Freeek","levelAuthorName":"freeek","bpm":139},"stats":{"downloads":941091,"plays":117624,"downVotes":768,"upVotes":12584,"heat":51.2995594,"rating":0.9171309232285056},"description":"Easy/Normal/Hard/Expert - Obstacles and mines purely for dance moves! 100% Expert Playthrough: https://bit.ly/2IKzCp3\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62d6","key":"217","name":"Beat it - Michael Jackson","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T14:20:19.000Z","hash":"4b2da842b687ec4cfbc948c583c21c79d4120de0","directDownload":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.zip","downloadURL":"/api/download/key/217","coverURL":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":640.7428588867188,"length":311,"bombs":57,"notes":423,"obstacles":33,"njs":10,"njsOffset":0},"expert":{"duration":640.7428588867188,"length":311,"bombs":68,"notes":616,"obstacles":33,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Harder Better Faster Stronger","songSubName":"Daft Punk","songAuthorName":"RunRockGame","levelAuthorName":"runrockgame","bpm":123},"stats":{"downloads":939245,"plays":74223,"downVotes":761,"upVotes":13105,"heat":65.0537892,"rating":0.9199051796117618},"description":"Expert & Hard | 600+ Blocks | Full Song 3:44 | Includes Lighting. Request to: @themakertales","deletedAt":null,"_id":"5cff620c48229f7d88fc63dd","key":"32e","name":"Daft Punk - Harder Better Faster Stronger","uploader":{"_id":"5cff0b7398cc5a672c84f04e","username":"runrockgame"},"uploaded":"2018-06-01T18:01:45.000Z","hash":"7c7f38d467bb43fe11a142581e63e324622ecc71","directDownload":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.zip","downloadURL":"/api/download/key/32e","coverURL":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":623.3125,"length":214,"bombs":0,"notes":462,"obstacles":25,"njs":10,"njsOffset":0},"hard":{"duration":623.3125,"length":214,"bombs":0,"notes":639,"obstacles":40,"njs":10,"njsOffset":0},"expert":{"duration":623.3125,"length":214,"bombs":0,"notes":825,"obstacles":40,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Mr. Blue Sky","songSubName":"Electric Light Orchestra","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":174},"stats":{"downloads":929040,"plays":39426,"downVotes":485,"upVotes":22691,"heat":94.0178926,"rating":0.9558250129688451},"description":"Channel your inner Baby Groot. Normal, Hard, Expert\r\nSpecial thanks to BennydaBeast for his help on this track!","deletedAt":null,"_id":"5cff620d48229f7d88fc65f7","key":"570","name":"Mr. Blue Sky | Electric Light Orchestra","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-06-16T16:53:34.000Z","hash":"236173d5ba7dc379d480b9cb5fb6b4fa5abe77da","directDownload":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.zip","downloadURL":"/api/download/key/570","coverURL":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":590.65625,"length":232,"bombs":0,"notes":768,"obstacles":154,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Rasputin (Funk Overload)","songSubName":"","songAuthorName":"Jobas","levelAuthorName":"jobas","bpm":149},"stats":{"downloads":796456,"plays":29624,"downVotes":774,"upVotes":17434,"heat":40.1104306,"rating":0.9336181107580133},"description":"Hard\r\nBpm 147\r\nspeed up version of rasputin Original","deletedAt":null,"_id":"5cff620c48229f7d88fc61f0","key":"124","name":"Rasputin (Funk Overload)","uploader":{"_id":"5cff0b7298cc5a672c84e9a2","username":"jobas"},"uploaded":"2018-05-19T16:36:34.000Z","hash":"9a1d001995cc0a2014352aa7148cbcbf2e489d89","directDownload":"/cdn/124/9a1d001995cc0a2014352aa7148cbcbf2e489d89.zip","downloadURL":"/api/download/key/124","coverURL":"/cdn/124/9a1d001995cc0a2014352aa7148cbcbf2e489d89.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":473.1875,"length":228,"bombs":0,"notes":399,"obstacles":0,"njs":10,"njsOffset":0},"hard":{"duration":473.1875,"length":228,"bombs":0,"notes":496,"obstacles":0,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Seven Nation Army","songSubName":"The White Stripes","songAuthorName":"BlueASIS","levelAuthorName":"blueasis","bpm":124},"stats":{"downloads":776038,"plays":56470,"downVotes":437,"upVotes":11620,"heat":74.676625,"rating":0.93635850868144},"description":"UPDATED! @BlueASIS#4095 on Discord let me know what you think","deletedAt":null,"_id":"5cff620d48229f7d88fc64a0","key":"3fc","name":"The White Stripes - Seven Nation Army","uploader":{"_id":"5cff0b7298cc5a672c84eb5d","username":"blueasis"},"uploaded":"2018-06-06T18:51:03.000Z","hash":"0b0ad0f34b2d0687a9794bcf5019100fda06971e","directDownload":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.zip","downloadURL":"/api/download/key/3fc","coverURL":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":384,"length":136,"bombs":0,"notes":505,"obstacles":52,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Take On Me","songSubName":"","songAuthorName":"a-ha","levelAuthorName":"jackscape","bpm":168},"stats":{"downloads":770057,"plays":36801,"downVotes":549,"upVotes":5946,"heat":18.5911969,"rating":0.8859054068140281},"description":"Expert only","deletedAt":null,"_id":"5cff620c48229f7d88fc60e7","key":"9","name":"a-ha - Take On Me","uploader":{"_id":"5cff0b7298cc5a672c84e8bb","username":"jackscape"},"uploaded":"2018-05-08T17:44:17.000Z","hash":"2aa1f5192828e075c30dd015b1e132bba912eb86","directDownload":"/cdn/9/2aa1f5192828e075c30dd015b1e132bba912eb86.zip","downloadURL":"/api/download/key/9","coverURL":"/cdn/9/2aa1f5192828e075c30dd015b1e132bba912eb86.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":342.8125,"length":165,"bombs":0,"notes":313,"obstacles":27,"njs":10,"njsOffset":0},"normal":{"duration":343.8125,"length":166,"bombs":0,"notes":480,"obstacles":27,"njs":10,"njsOffset":0},"hard":{"duration":343.8125,"length":166,"bombs":0,"notes":730,"obstacles":27,"njs":10,"njsOffset":0},"expert":{"duration":341.75,"length":165,"bombs":11,"notes":735,"obstacles":2,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Lone Digger","songSubName":"","songAuthorName":"Caravan Palace","levelAuthorName":"calijor","bpm":124},"stats":{"downloads":677450,"plays":57999,"downVotes":823,"upVotes":14212,"heat":46.3871704,"rating":0.920647601959446},"description":"Caravan Palace - Lone Digger\r\nEasy | Normal | Hard | Expert\r\nThis is a re-upload of my previous map, with improvements for hard, and a new, harder expert difficulty mapped by Squeaksies, as well as lower difficulties as iterations on my original map.\r\n\r\nBPM: 124\r\nDuration: 2:49\r\nNotes (Hard): 730\r\nNotes (Expert): 735\r\nPreview (Hard): https://youtu.be/NExvLUyeBUU\r\nPreview (Expert): https://youtu.be/NYmExXlpB0k","deletedAt":null,"_id":"5cff620c48229f7d88fc6282","key":"1bf","name":"Caravan Palace - Lone Digger","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-23T00:15:19.000Z","hash":"906160fd1f808e2f34f33c2ca5920118855c065d","directDownload":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.zip","downloadURL":"/api/download/key/1bf","coverURL":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":382.4375,"length":246,"bombs":0,"notes":728,"obstacles":16,"njs":10,"njsOffset":0},"hard":{"duration":387.4375,"length":249,"bombs":0,"notes":836,"obstacles":19,"njs":10,"njsOffset":0},"expert":{"duration":387.4375,"length":249,"bombs":0,"notes":883,"obstacles":31,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Africa","songSubName":"","songAuthorName":"Toto","levelAuthorName":"calijor","bpm":92},"stats":{"downloads":669322,"plays":27043,"downVotes":1106,"upVotes":5060,"heat":40.3054811,"rating":0.7974511907115919},"description":"Bless the rains!\r\n\r\nExpert, hard, and normal difficulty available. I do apologize, but I think they're a bit harder than vanilla.\r\n\r\nBPM: 92\r\nNotes: 883 (expert)\r\nDuration: 4:20\r\n\r\nPreview: https://youtu.be/SLpUwKson80","deletedAt":null,"_id":"5cff620c48229f7d88fc6203","key":"137","name":"Toto - Africa","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-20T02:51:20.000Z","hash":"12fee98db7d2080724435d0a1442545f21a9134d","directDownload":"/cdn/137/12fee98db7d2080724435d0a1442545f21a9134d.zip","downloadURL":"/api/download/key/137","coverURL":"/cdn/137/12fee98db7d2080724435d0a1442545f21a9134d.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_downloads().unwrap();
}
#[test]
fn test_maps_plays() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/plays").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":328.556396484375,"length":142,"bombs":0,"notes":188,"obstacles":84,"njs":10,"njsOffset":0},"normal":{"duration":328.681396484375,"length":142,"bombs":40,"notes":219,"obstacles":70,"njs":10,"njsOffset":0},"hard":{"duration":328.681396484375,"length":142,"bombs":42,"notes":386,"obstacles":72,"njs":10,"njsOffset":0},"expert":{"duration":328.681396484375,"length":142,"bombs":46,"notes":623,"obstacles":69,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Beat it","songSubName":"Michael Jackson","songAuthorName":"Freeek","levelAuthorName":"freeek","bpm":139},"stats":{"downloads":941091,"plays":117624,"downVotes":768,"upVotes":12584,"heat":51.2995594,"rating":0.9171309232285056},"description":"Easy/Normal/Hard/Expert - Obstacles and mines purely for dance moves! 100% Expert Playthrough: https://bit.ly/2IKzCp3\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62d6","key":"217","name":"Beat it - Michael Jackson","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T14:20:19.000Z","hash":"4b2da842b687ec4cfbc948c583c21c79d4120de0","directDownload":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.zip","downloadURL":"/api/download/key/217","coverURL":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":468,"length":212,"bombs":4,"notes":415,"obstacles":42,"njs":10,"njsOffset":0},"hard":{"duration":468,"length":212,"bombs":40,"notes":695,"obstacles":94,"njs":10,"njsOffset":0},"expert":{"duration":468,"length":212,"bombs":50,"notes":932,"obstacles":103,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Gangnam Style","songSubName":"PSY","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":132},"stats":{"downloads":1069207,"plays":82700,"downVotes":617,"upVotes":17445,"heat":41.5047436,"rating":0.94147214608232},"description":"Expert, Hard, and Normal tracks. I tried my best to setup the chorus charts to allow you to mimic the classic dance moves. I think it matches up quite nicely. I hope you have as much fun playing as I did making this! Enjoy!","deletedAt":null,"_id":"5cff620c48229f7d88fc620d","key":"141","name":"GANGNAM STYLE","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-05-20T09:59:02.000Z","hash":"8e7e553099436af31564adf1977a5ec42a61cfff","directDownload":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.zip","downloadURL":"/api/download/key/141","coverURL":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":640.7428588867188,"length":311,"bombs":57,"notes":423,"obstacles":33,"njs":10,"njsOffset":0},"expert":{"duration":640.7428588867188,"length":311,"bombs":68,"notes":616,"obstacles":33,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Harder Better Faster Stronger","songSubName":"Daft Punk","songAuthorName":"RunRockGame","levelAuthorName":"runrockgame","bpm":123},"stats":{"downloads":939245,"plays":74223,"downVotes":761,"upVotes":13105,"heat":65.0537892,"rating":0.9199051796117618},"description":"Expert & Hard | 600+ Blocks | Full Song 3:44 | Includes Lighting. Request to: @themakertales","deletedAt":null,"_id":"5cff620c48229f7d88fc63dd","key":"32e","name":"Daft Punk - Harder Better Faster Stronger","uploader":{"_id":"5cff0b7398cc5a672c84f04e","username":"runrockgame"},"uploaded":"2018-06-01T18:01:45.000Z","hash":"7c7f38d467bb43fe11a142581e63e324622ecc71","directDownload":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.zip","downloadURL":"/api/download/key/32e","coverURL":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":418,"length":200,"bombs":0,"notes":546,"obstacles":10,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Believer","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":1045930,"plays":70725,"downVotes":352,"upVotes":9390,"heat":18.911539,"rating":0.9346479331024395},"description":"Currently expert only. Events included.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e9","key":"b","name":"Imagine Dragons - Believer","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-05-08T18:56:36.000Z","hash":"19f2879d11a91b51a5c090d63471c3e8d9b7aee3","directDownload":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.zip","downloadURL":"/api/download/key/b","coverURL":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":342.8125,"length":165,"bombs":0,"notes":313,"obstacles":27,"njs":10,"njsOffset":0},"normal":{"duration":343.8125,"length":166,"bombs":0,"notes":480,"obstacles":27,"njs":10,"njsOffset":0},"hard":{"duration":343.8125,"length":166,"bombs":0,"notes":730,"obstacles":27,"njs":10,"njsOffset":0},"expert":{"duration":341.75,"length":165,"bombs":11,"notes":735,"obstacles":2,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Lone Digger","songSubName":"","songAuthorName":"Caravan Palace","levelAuthorName":"calijor","bpm":124},"stats":{"downloads":677451,"plays":57999,"downVotes":823,"upVotes":14212,"heat":46.3871704,"rating":0.920647601959446},"description":"Caravan Palace - Lone Digger\r\nEasy | Normal | Hard | Expert\r\nThis is a re-upload of my previous map, with improvements for hard, and a new, harder expert difficulty mapped by Squeaksies, as well as lower difficulties as iterations on my original map.\r\n\r\nBPM: 124\r\nDuration: 2:49\r\nNotes (Hard): 730\r\nNotes (Expert): 735\r\nPreview (Hard): https://youtu.be/NExvLUyeBUU\r\nPreview (Expert): https://youtu.be/NYmExXlpB0k","deletedAt":null,"_id":"5cff620c48229f7d88fc6282","key":"1bf","name":"Caravan Palace - Lone Digger","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-23T00:15:19.000Z","hash":"906160fd1f808e2f34f33c2ca5920118855c065d","directDownload":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.zip","downloadURL":"/api/download/key/1bf","coverURL":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":473.1875,"length":228,"bombs":0,"notes":399,"obstacles":0,"njs":10,"njsOffset":0},"hard":{"duration":473.1875,"length":228,"bombs":0,"notes":496,"obstacles":0,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Seven Nation Army","songSubName":"The White Stripes","songAuthorName":"BlueASIS","levelAuthorName":"blueasis","bpm":124},"stats":{"downloads":776038,"plays":56470,"downVotes":437,"upVotes":11620,"heat":74.676625,"rating":0.93635850868144},"description":"UPDATED! @BlueASIS#4095 on Discord let me know what you think","deletedAt":null,"_id":"5cff620d48229f7d88fc64a0","key":"3fc","name":"The White Stripes - Seven Nation Army","uploader":{"_id":"5cff0b7298cc5a672c84eb5d","username":"blueasis"},"uploaded":"2018-06-06T18:51:03.000Z","hash":"0b0ad0f34b2d0687a9794bcf5019100fda06971e","directDownload":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.zip","downloadURL":"/api/download/key/3fc","coverURL":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":183.5,"length":81,"bombs":0,"notes":174,"obstacles":0,"njs":10,"njsOffset":0},"expert":{"duration":183.5,"length":81,"bombs":0,"notes":262,"obstacles":0,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Unravel","songSubName":"(TV Size)","songAuthorName":"TK","levelAuthorName":"winepic","bpm":135},"stats":{"downloads":444166,"plays":52247,"downVotes":369,"upVotes":4150,"heat":18.3311622,"rating":0.8851378895668524},"description":"Map made by me. Includes Hard and Expert difficulties.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e5","key":"7","name":"Unravel (Tokyo Ghoul OP) TV Size","uploader":{"_id":"5cff0b7298cc5a672c84e8b6","username":"winepic"},"uploaded":"2018-05-08T16:25:10.000Z","hash":"b9867cdccf8b27d7a174c861adc69215c86cdab8","directDownload":"/cdn/7/b9867cdccf8b27d7a174c861adc69215c86cdab8.zip","downloadURL":"/api/download/key/7","coverURL":"/cdn/7/b9867cdccf8b27d7a174c861adc69215c86cdab8.png"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":265.510009765625,"length":189,"bombs":0,"notes":297,"obstacles":57,"njs":10,"njsOffset":0},"normal":{"duration":264.510009765625,"length":188,"bombs":0,"notes":358,"obstacles":62,"njs":10,"njsOffset":0},"hard":{"duration":266.010009765625,"length":190,"bombs":0,"notes":514,"obstacles":67,"njs":10,"njsOffset":0},"expert":{"duration":276.010009765625,"length":197,"bombs":0,"notes":681,"obstacles":67,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Clint Eastwood","songSubName":"Gorillaz","songAuthorName":"unknow","levelAuthorName":"freeek","bpm":84},"stats":{"downloads":471361,"plays":51819,"downVotes":372,"upVotes":5758,"heat":51.4893997,"rating":0.9075010599167767},"description":"Easy/Normal/Hard/Expert - Audio is as loud without clipping I swear! 100% Expert Playthrough: https://bit.ly/2LuFcxq\r\n\r\nHave fun! =D\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62e4","key":"225","name":"Clint Eastwood - Gorillaz","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T20:58:36.000Z","hash":"507f0e09326d37e09dca08e3c2597f027dbe1940","directDownload":"/cdn/225/507f0e09326d37e09dca08e3c2597f027dbe1940.zip","downloadURL":"/api/download/key/225","coverURL":"/cdn/225/507f0e09326d37e09dca08e3c2597f027dbe1940.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":189,"length":90,"bombs":0,"notes":330,"obstacles":0,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Super Mario Bros. Theme (Overworld Theme)","songSubName":"Nintendo","songAuthorName":"red knight","levelAuthorName":"redknight","bpm":125},"stats":{"downloads":552611,"plays":49329,"downVotes":1093,"upVotes":4653,"heat":22.15705,"rating":0.7869063116417228},"description":"Expert only","deletedAt":null,"_id":"5cff620c48229f7d88fc6106","key":"29","name":"Super Mario Bros Theme","uploader":{"_id":"5cff0b7298cc5a672c84e917","username":"redknight"},"uploaded":"2018-05-10T16:34:12.000Z","hash":"c1c8e2b9394050afad435608137941da0b64b8f3","directDownload":"/cdn/29/c1c8e2b9394050afad435608137941da0b64b8f3.zip","downloadURL":"/api/download/key/29","coverURL":"/cdn/29/c1c8e2b9394050afad435608137941da0b64b8f3.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":472.5,"length":232,"bombs":0,"notes":373,"obstacles":11,"njs":10,"njsOffset":0},"hard":{"duration":472.5,"length":232,"bombs":0,"notes":503,"obstacles":14,"njs":10,"njsOffset":0},"expert":{"duration":472.5,"length":232,"bombs":0,"notes":682,"obstacles":30,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Livin' On A Prayer","songSubName":"Bon Jovi","songAuthorName":"Bon Jovi","levelAuthorName":"jnua12345","bpm":122},"stats":{"downloads":472998,"plays":47593,"downVotes":840,"upVotes":2606,"heat":34.0630574,"rating":0.7341707864621012},"description":"Expert, Hard, Normal 122BPM","deletedAt":null,"_id":"5cff620c48229f7d88fc6194","key":"bd","name":"Bon Jovi - Livin' On A Prayer","uploader":{"_id":"5cff0b7298cc5a672c84e9da","username":"jnua12345"},"uploaded":"2018-05-17T01:12:03.000Z","hash":"4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88","directDownload":"/cdn/bd/4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88.zip","downloadURL":"/api/download/key/bd","coverURL":"/cdn/bd/4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_plays().unwrap();
}
#[test]
fn test_user() {
let client = FakeClient::new(
BEATSAVER_URL
.join("api/users/find/5fbe7cd60192c700062b2a1f")
.unwrap(),
r#"{"_id":"5fbe7cd60192c700062b2a1f","username":"qw3rty01"}"#.into(),
);
client.user("5fbe7cd60192c700062b2a1f".to_string()).unwrap();
}
#[test]
fn test_search() {
let client = FakeClient::new(BEATSAVER_URL.join("api/search/text?q=datkami").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86172,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273593,"plays":31684,"downVotes":178,"upVotes":4248,"heat":21.0823944,"rating":0.923057857514794},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21773,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40640,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client.search("datkami".to_string()).unwrap();
}
#[test]
fn test_search_advanced() {
let client = FakeClient::new(BEATSAVER_URL.join("api/search/advanced?q=metadata.levelAuthor%3Adatkami").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86172,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273593,"plays":31684,"downVotes":178,"upVotes":4248,"heat":21.0823944,"rating":0.923057857514794},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21773,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40640,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client
.search_advanced("metadata.levelAuthor:datkami".to_string())
.unwrap();
}
#[test]
fn test_download() {
let client = FakeClient::new(
BEATSAVER_URL.join("api/download/key/1").unwrap(),
"map #1".into(),
);
client.download("1".try_into().unwrap()).unwrap();
let client = FakeClient::new(
BEATSAVER_URL
.join("api/download/hash/fda568fc27c20d21f8dc6f3709b49b5cc96723be")
.unwrap(),
"map #1".into(),
);
client
.download(
"fda568fc27c20d21f8dc6f3709b49b5cc96723be"
.try_into()
.unwrap(),
)
.unwrap();
}
}
#[cfg(feature = "async-std")]
mod async_std_tests {
use crate::tests::FakeClient;
use crate::BEATSAVER_URL;
use crate::{BeatSaverApiAsync, BeatSaverUser};
use async_std::test as async_test;
use std::convert::TryInto;
#[async_test]
async fn test_map() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/detail/1").unwrap(), r#"{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}"#.into());
client
.map(&"1".to_string().try_into().unwrap())
.await
.unwrap();
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/by-hash/fda568fc27c20d21f8dc6f3709b49b5cc96723be").unwrap(), r#"{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}"#.into());
client
.map(
&"fda568fc27c20d21f8dc6f3709b49b5cc96723be"
.to_string()
.try_into()
.unwrap(),
)
.await
.unwrap();
}
#[async_test]
async fn test_maps_by() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/uploader/5cff0b7298cc5a672c84e8a3").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40619,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21772,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273492,"plays":31684,"downVotes":177,"upVotes":4246,"heat":21.0822877,"rating":0.9232332918273986},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client
.maps_by(&BeatSaverUser {
id: "5cff0b7298cc5a672c84e8a3".to_string(),
username: "datkami".to_string(),
})
.await
.unwrap();
}
#[async_test]
async fn test_maps_hot() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/hot").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":false,"hard":false,"normal":false},"duration":13,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":13.625,"length":11,"njs":18,"njsOffset":1,"bombs":0,"notes":25,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Lawless"}],"levelAuthorName":"Chief Queef","songAuthorName":" ","songName":"*teleports behind you*","songSubName":"","bpm":69},"stats":{"downloads":494,"plays":0,"downVotes":0,"upVotes":10,"heat":1803.8752302,"rating":0.7570708845427101},"description":"nothing personnel kid","deletedAt":null,"_id":"5fbd9da95fd85f000691e895","key":"1146c","name":"*teleports behind you*","uploader":{"_id":"5f9a4d2a030219000627c2bf","username":"chief queef"},"hash":"4447287810e6ad338f379677c9d383b1634d876d","uploaded":"2020-11-24T23:56:25.360Z","directDownload":"/cdn/1146c/4447287810e6ad338f379677c9d383b1634d876d.zip","downloadURL":"/api/download/key/1146c","coverURL":"/cdn/1146c/4447287810e6ad338f379677c9d383b1634d876d.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":true,"hard":false,"normal":false},"duration":225,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":312.15301513671875,"length":208,"njs":16,"njsOffset":-0.4000000059604645,"bombs":12,"notes":551,"obstacles":194},"expertPlus":{"duration":312.15301513671875,"length":208,"njs":16,"njsOffset":-0.4000000059604645,"bombs":12,"notes":564,"obstacles":220},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"AmpereBEEP","songAuthorName":"Madeon","songName":"Home","songSubName":"","bpm":90},"stats":{"downloads":513,"plays":0,"downVotes":2,"upVotes":8,"heat":1803.5866947,"rating":0.6542425307256261},"description":"Really? No maps of this song before? That's a surprise.\r\n\r\nThis song is nice and slow and the map fits it accordingly. Could be good for accuracy practice or just a good map for newer players to see some good flow. \r\n\r\nMap comes with 2 difficulties: Expert+ with 564 notes at 2.50 notes per second, and a slightly less difficult Expert with 551 notes at 2.44 notes per second. Both maps are nearly identical, with the Expert+ difficulty having dodge walls and a section that might be a little difficult to read for new players.\r\n\r\nIf you have any feedback or any suggestions, send it to AmpereBEEP#1723 on Discord.","deletedAt":null,"_id":"5fbd91f000e48a00065a7826","key":"11467","name":"Home - Madeon","uploader":{"_id":"5ed1475c9ae7380006c6f245","username":"amperebeep"},"hash":"059a919433c73ebf299b32ec351b60adf50add89","uploaded":"2020-11-24T23:06:24.457Z","directDownload":"/cdn/11467/059a919433c73ebf299b32ec351b60adf50add89.zip","downloadURL":"/api/download/key/11467","coverURL":"/cdn/11467/059a919433c73ebf299b32ec351b60adf50add89.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":152,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":287.7916564941406,"length":150,"njs":18,"njsOffset":-0.30000001192092896,"bombs":0,"notes":763,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"EPG7ENS","songAuthorName":"MACROSS 82-99","songName":"89.22 FM","songSubName":"","bpm":115},"stats":{"downloads":680,"plays":0,"downVotes":0,"upVotes":9,"heat":1803.4551916,"rating":0.75},"description":"i'm kinda into japanese city pop rn\nenjoy ;)","deletedAt":null,"_id":"5fbd5bde5fd85f00069186b4","key":"11435","name":"82.99 MACROSS 82-99","uploader":{"_id":"5cff0b7798cc5a672c855bb6","username":"epg7ens"},"hash":"7555522308b9ed339a03ea574dd0b298d323349f","uploaded":"2020-11-24T19:15:42.711Z","directDownload":"/cdn/11435/7555522308b9ed339a03ea574dd0b298d323349f.zip","downloadURL":"/api/download/key/11435","coverURL":"/cdn/11435/7555522308b9ed339a03ea574dd0b298d323349f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":317,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":904.8702392578125,"length":313,"njs":20,"njsOffset":-0.3199999928474426,"bombs":0,"notes":1914,"obstacles":116},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"EOP Glacier","songAuthorName":"Hatsuki Yura","songName":"Drivi'n Greedy","songSubName":"Nhato Remix","bpm":173},"stats":{"downloads":330,"plays":0,"downVotes":0,"upVotes":3,"heat":1803.443705,"rating":0.6705937099936721},"description":"This has been in my WIP folder for months but it's finally finished\n\nSong Stats:\nTop/Middle/Bottom Split:\n10%/32%/57%\nNPS: 6.02\nLights: 4,191","deletedAt":null,"_id":"5fbdadb8e3a5a20006f981d6","key":"11482","name":"Hatsuki Yura - Drivi'n Greedy","uploader":{"_id":"5d50e360adb1a20006305ca0","username":"eop glacier"},"hash":"2d000f27e4bf8a591f16cdd5322279186492b3ea","uploaded":"2020-11-25T01:04:56.269Z","directDownload":"/cdn/11482/2d000f27e4bf8a591f16cdd5322279186492b3ea.zip","downloadURL":"/api/download/key/11482","coverURL":"/cdn/11482/2d000f27e4bf8a591f16cdd5322279186492b3ea.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":110,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":174.537,"length":58,"njs":23,"njsOffset":-0.5,"bombs":6,"notes":333,"obstacles":46},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Astrella","songAuthorName":"Breakmaster Cylinder","songName":"The Most Gangster Drop","songSubName":"","bpm":180},"stats":{"downloads":16,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3840344,"rating":0},"description":"gangster awehfiuawefluiawehfaiuwhfewaf","deletedAt":null,"_id":"5fbdf719ea68e70007b21333","key":"1149e","name":"The Most Gangster Drop - Breakmaster Cylinder","uploader":{"_id":"5fa1e74381e1d70006f2cc01","username":"c0r3nn"},"hash":"d6a267ea3d6a0d715d1d320e7773ad646aa2a424","uploaded":"2020-11-25T06:18:01.546Z","directDownload":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.zip","downloadURL":"/api/download/key/1149e","coverURL":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":239,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":243.375,"length":101,"njs":12,"njsOffset":0,"bombs":0,"notes":300,"obstacles":2},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Packz","songAuthorName":"Illenium, John Bellion","songName":"Good Things Fall Apart - Illenium, John Bellion","songSubName":"","bpm":144},"stats":{"downloads":74,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3043823,"rating":0},"description":"this is a test map dont download","deletedAt":null,"_id":"5fbde91900e48a00065ae757","key":"1149d","name":"tyui","uploader":{"_id":"5f9a3ba76ef6a20006d59aea","username":"milla"},"hash":"eb7f40e59ee44be638054b3ca41f4f4b7b5b357f","uploaded":"2020-11-25T05:18:17.204Z","directDownload":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.zip","downloadURL":"/api/download/key/1149d","coverURL":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":254,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":567.219970703125,"length":243,"njs":21,"njsOffset":0.20000000298023224,"bombs":0,"notes":1253,"obstacles":7},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"night","songAuthorName":"Coheed and Cambria","songName":"Unheavenly Creatures","songSubName":"","bpm":140},"stats":{"downloads":409,"plays":0,"downVotes":0,"upVotes":3,"heat":1803.2977382,"rating":0.6705937099936721},"description":"Had fun mapping this one :)\nSend Feedback on Discord: night#0101","deletedAt":null,"_id":"5fbd940f9107590006129976","key":"1146a","name":"Coheed and Cambria - Unheavenly Creatures","uploader":{"_id":"5e244b8c003ea300067e67eb","username":"night"},"hash":"708d4a5c44c45a57d636b21c531cddde71674302","uploaded":"2020-11-24T23:15:27.762Z","directDownload":"/cdn/1146a/708d4a5c44c45a57d636b21c531cddde71674302.zip","downloadURL":"/api/download/key/1146a","coverURL":"/cdn/1146a/708d4a5c44c45a57d636b21c531cddde71674302.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":74,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":399,"length":106,"njs":23,"njsOffset":-0.20000000298023224,"bombs":0,"notes":931,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"DE125","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix) (Literally Just the First Drop Ver.)","bpm":225},"stats":{"downloads":85,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2910497,"rating":0},"description":"Literally just the first drop.\nI overmapped this so the pattern would work B)\n\nDm with issues @DE125#0001 if the issue isn't cringe saut burnt rice pattern","deletedAt":null,"_id":"5fbde6c1ea68e70007b20165","key":"1149c","name":"you - Melancholia (EKU's Desolation Remix) (TV Size)","uploader":{"_id":"5cff0b7798cc5a672c8554ba","username":"de125"},"hash":"2cb3a27602b362a6265fdfd543f4eec31f957ba4","uploaded":"2020-11-25T05:08:17.236Z","directDownload":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.zip","downloadURL":"/api/download/key/1149c","coverURL":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":false,"hard":false,"normal":false},"duration":6,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":15.5,"length":5,"njs":18,"njsOffset":0,"bombs":0,"notes":6,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Reddek","songAuthorName":"G","songName":"I like your cock G","songSubName":"","bpm":157.1999969482422},"stats":{"downloads":585,"plays":0,"downVotes":0,"upVotes":5,"heat":1803.273026,"rating":0.7084432256108616},"description":"why not","deletedAt":null,"_id":"5fbd68b800e48a00065a3663","key":"11445","name":"I like your cock G","uploader":{"_id":"5dbfb4426dea0b0006bd328d","username":"reddek"},"hash":"d3be6bc67cda1f13b3ac91c6b98d90605153f7f9","uploaded":"2020-11-24T20:10:32.522Z","directDownload":"/cdn/11445/d3be6bc67cda1f13b3ac91c6b98d90605153f7f9.zip","downloadURL":"/api/download/key/11445","coverURL":"/cdn/11445/d3be6bc67cda1f13b3ac91c6b98d90605153f7f9.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":true,"expertPlus":false,"hard":true,"normal":true},"duration":96,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":269.302083,"length":89,"njs":8,"njsOffset":0,"bombs":0,"notes":179,"obstacles":18},"expert":{"duration":269.302083,"length":89,"njs":15,"njsOffset":0,"bombs":14,"notes":403,"obstacles":112},"expertPlus":null,"hard":{"duration":269.302083,"length":89,"njs":13,"njsOffset":0,"bombs":11,"notes":360,"obstacles":102},"normal":{"duration":269.302083,"length":89,"njs":10,"njsOffset":0,"bombs":20,"notes":286,"obstacles":30}},"name":"Standard"}],"levelAuthorName":"rodysan","songAuthorName":"Ryu*","songName":"Sakura Sunrise","songSubName":"","bpm":181},"stats":{"downloads":91,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2705277,"rating":0},"description":"9","deletedAt":null,"_id":"5fbde325ea68e70007b1fd1e","key":"1149b","name":"Sakura Sunrise - Ryu☆","uploader":{"_id":"5fabfd44fe23c6000688154a","username":"rodysan"},"hash":"eea9c9813c1a06ce2ea754a4d4557f98bdc33d33","uploaded":"2020-11-25T04:52:53.745Z","directDownload":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.zip","downloadURL":"/api/download/key/1149b","coverURL":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.png"}],"totalDocs":35532,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_hot().await.unwrap();
}
#[async_test]
async fn test_maps_rating() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/rating").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":true},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":417,"length":195,"bombs":4,"notes":301,"obstacles":24,"njs":10,"njsOffset":0},"hard":{"duration":417,"length":195,"bombs":4,"notes":486,"obstacles":24,"njs":10,"njsOffset":0},"expert":{"duration":417.5,"length":195,"bombs":4,"notes":620,"obstacles":24,"njs":10,"njsOffset":0},"expertPlus":{"duration":417.5,"length":195,"bombs":0,"notes":894,"obstacles":0,"njs":12,"njsOffset":0}}}],"songName":"Shut Up and Dance","songSubName":"WALK THE MOON","songAuthorName":"BennyDaBeast","levelAuthorName":"bennydabeast","bpm":128},"stats":{"downloads":422048,"plays":558,"downVotes":136,"upVotes":10824,"heat":395.8248964,"rating":0.9579470354714587},"description":"Difficulties: Expert+ (Added 11/15), Expert, Hard, Normal\r\nYouTube Preview: https://youtu.be/x9hJbTlPQUY","deletedAt":null,"_id":"5cff621148229f7d88fc77c9","key":"2144","name":"Shut Up and Dance - WALK THE MOON","uploader":{"_id":"5cff0b7298cc5a672c84e98d","username":"bennydabeast"},"uploaded":"2018-11-21T01:27:00.000Z","hash":"89cf8bb07afb3c59ae7b5ac00337d62261c36fb4","directDownload":"/cdn/2144/89cf8bb07afb3c59ae7b5ac00337d62261c36fb4.zip","downloadURL":"/api/download/key/2144","coverURL":"/cdn/2144/89cf8bb07afb3c59ae7b5ac00337d62261c36fb4.png"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":623.3125,"length":214,"bombs":0,"notes":462,"obstacles":25,"njs":10,"njsOffset":0},"hard":{"duration":623.3125,"length":214,"bombs":0,"notes":639,"obstacles":40,"njs":10,"njsOffset":0},"expert":{"duration":623.3125,"length":214,"bombs":0,"notes":825,"obstacles":40,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Mr. Blue Sky","songSubName":"Electric Light Orchestra","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":174},"stats":{"downloads":929036,"plays":39426,"downVotes":485,"upVotes":22691,"heat":94.0178926,"rating":0.9558250129688451},"description":"Channel your inner Baby Groot. Normal, Hard, Expert\r\nSpecial thanks to BennydaBeast for his help on this track!","deletedAt":null,"_id":"5cff620d48229f7d88fc65f7","key":"570","name":"Mr. Blue Sky | Electric Light Orchestra","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-06-16T16:53:34.000Z","hash":"236173d5ba7dc379d480b9cb5fb6b4fa5abe77da","directDownload":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.zip","downloadURL":"/api/download/key/570","coverURL":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":475,"length":226,"bombs":0,"notes":620,"obstacles":10,"njs":10,"njsOffset":0},"expert":{"duration":475,"length":226,"bombs":0,"notes":738,"obstacles":11,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Feel Invincible","songSubName":"Skillet","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":126},"stats":{"downloads":266051,"plays":3479,"downVotes":90,"upVotes":7150,"heat":231.7515825,"rating":0.9539859440299348},"description":"Expert / Hard\r\nhttps://www.youtube.com/watch?v=nq-Qul4XxbE","deletedAt":null,"_id":"5cff620f48229f7d88fc6eba","key":"121f","name":"Skillet - Feel Invincible","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-08-27T16:47:05.000Z","hash":"2e9ab6e1fb8055649e241cade98b018926cc93a8","directDownload":"/cdn/121f/2e9ab6e1fb8055649e241cade98b018926cc93a8.zip","downloadURL":"/api/download/key/121f","coverURL":"/cdn/121f/2e9ab6e1fb8055649e241cade98b018926cc93a8.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":476.7637634277344,"length":173,"bombs":52,"notes":722,"obstacles":28,"njs":14,"njsOffset":0},"expertPlus":null}}],"songName":"Caramelldansen (Speedcake Remix)","songSubName":"Caramell","songAuthorName":"Dack","levelAuthorName":"Dack","bpm":165},"stats":{"downloads":257793,"plays":0,"downVotes":249,"upVotes":13203,"heat":604.9856039,"rating":0.9539671938016036},"description":"Preview: https://youtu.be/V5p0HOzunY0\n\n\nPatreon: https://www.patreon.com/Dack","deletedAt":null,"_id":"5cff621548229f7d88fc8904","key":"3cf5","name":"Caramelldansen","uploader":{"_id":"5cff0b7598cc5a672c852c6f","username":"dack"},"uploaded":"2019-03-09T22:54:54.000Z","hash":"cf5e32d6b7f30095f7198da5894139c92336cad7","directDownload":"/cdn/3cf5/cf5e32d6b7f30095f7198da5894139c92336cad7.zip","downloadURL":"/api/download/key/3cf5","coverURL":"/cdn/3cf5/cf5e32d6b7f30095f7198da5894139c92336cad7.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":418,"length":200,"bombs":0,"notes":216,"obstacles":0,"njs":10,"njsOffset":0},"normal":{"duration":418,"length":200,"bombs":0,"notes":388,"obstacles":8,"njs":10,"njsOffset":0},"hard":{"duration":418,"length":200,"bombs":0,"notes":514,"obstacles":10,"njs":11,"njsOffset":0},"expert":{"duration":418,"length":200,"bombs":0,"notes":560,"obstacles":12,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Believer (100k ver.)","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":514839,"plays":9381,"downVotes":217,"upVotes":11958,"heat":379.9016606,"rating":0.953774738159888},"description":"This is one of the 22 maps that were mapped for the 100k Contest where you can win over $7,000 in prizes. Go to https://bsaber.com/100k-contest/ to register!","deletedAt":null,"_id":"5cff621148229f7d88fc76ec","key":"1fef","name":"Imagine Dragons - Believer (100k ver.) | 100k Contest","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-11-12T17:53:58.000Z","hash":"9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390","directDownload":"/cdn/1fef/9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390.zip","downloadURL":"/api/download/key/1fef","coverURL":"/cdn/1fef/9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":501.19000244140625,"length":227,"bombs":0,"notes":671,"obstacles":16,"njs":10,"njsOffset":0},"expert":{"duration":501.19000244140625,"length":227,"bombs":0,"notes":831,"obstacles":16,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Daddy","songSubName":"PSY","songAuthorName":"Fafurion","levelAuthorName":"fafurion","bpm":132},"stats":{"downloads":251102,"plays":2330,"downVotes":123,"upVotes":8386,"heat":243.8954711,"rating":0.953687887575571},"description":"Insanely fun dance map! Enjoy!\r\nSee the map in action (Expert): https://www.youtube.com/watch?v=cWz6flYGs20\r\n\r\nThank you to my playtesters:\r\nQTPop (https://www.twitch.tv/qtpop)\r\nDuoVR (https://www.twitch.tv/duovr)\r\nSourgurl (https://www.twitch.tv/sourgurl)\r\nRexxxzi (https://www.twitch.tv/rexxxzi)\r\nAshleyriott (https://www.twitch.tv/ashleyriott)\r\n\r\nDiscord: @Fufu#5452","deletedAt":null,"_id":"5cff620f48229f7d88fc6f6c","key":"133b","name":"Daddy - PSY","uploader":{"_id":"5cff0b7398cc5a672c84f945","username":"fafurion"},"uploaded":"2018-09-02T23:43:45.000Z","hash":"dc489921185f92dfecb9cb07b84fc556123bd134","directDownload":"/cdn/133b/dc489921185f92dfecb9cb07b84fc556123bd134.zip","downloadURL":"/api/download/key/133b","coverURL":"/cdn/133b/dc489921185f92dfecb9cb07b84fc556123bd134.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":523.625,"length":245,"bombs":0,"notes":633,"obstacles":13,"njs":10,"njsOffset":0},"expert":{"duration":523.5650024414062,"length":245,"bombs":0,"notes":880,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Uprising","songSubName":"Muse","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":128},"stats":{"downloads":458225,"plays":11598,"downVotes":163,"upVotes":9224,"heat":84.4207539,"rating":0.9518918933740727},"description":"Expert / Hard\r\nhttps://youtu.be/WpFUt3UNp7c","deletedAt":null,"_id":"5cff620d48229f7d88fc655e","key":"4c6","name":"Muse - Uprising","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-06-11T21:47:41.000Z","hash":"00e5671e594a6fe621c3605fcc5a0e4466ba6478","directDownload":"/cdn/4c6/00e5671e594a6fe621c3605fcc5a0e4466ba6478.zip","downloadURL":"/api/download/key/4c6","coverURL":"/cdn/4c6/00e5671e594a6fe621c3605fcc5a0e4466ba6478.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":true,"hard":false,"normal":false},"duration":0,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":547,"length":234,"njs":12,"njsOffset":0,"bombs":0,"notes":705,"obstacles":10},"expertPlus":{"duration":547,"length":234,"njs":16,"njsOffset":0,"bombs":0,"notes":876,"obstacles":10},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"KikaeAeon","songAuthorName":"League of Legends & Against The Current","songName":"Legends Never Die","songSubName":"","bpm":140},"stats":{"downloads":142656,"plays":0,"downVotes":87,"upVotes":6241,"heat":997.2555043,"rating":0.9513740970623574},"description":"A special request from Prima1URGE","deletedAt":null,"_id":"5d91d6c1871b1a0006f9b3e7","key":"66e6","name":"League of Legends - Legends never die (ft. Against The Current)","uploader":{"_id":"5cff0b7498cc5a672c85109b","username":"kikaeaeon"},"hash":"732bd4072b89d4b3bf0e63db812a7ffc3096e837","uploaded":"2019-09-30T10:19:45.606Z","directDownload":"/cdn/66e6/732bd4072b89d4b3bf0e63db812a7ffc3096e837.zip","downloadURL":"/api/download/key/66e6","coverURL":"/cdn/66e6/732bd4072b89d4b3bf0e63db812a7ffc3096e837.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":578,"length":194,"bombs":8,"notes":519,"obstacles":86,"njs":13,"njsOffset":0},"expert":{"duration":578,"length":194,"bombs":10,"notes":679,"obstacles":86,"njs":16,"njsOffset":0},"expertPlus":null}}],"songName":"Flamingo","songSubName":"Kero Kero Bonito","songAuthorName":"ETAN","levelAuthorName":"ETAN","bpm":178},"stats":{"downloads":142323,"plays":0,"downVotes":90,"upVotes":6344,"heat":744.9785357,"rating":0.9513253928566593},"description":"edited: NJS was a tad slow my b\r\nfuramingo \r\noh oh ooh oh\r\nthis needed to be remapped\r\n \r\nPlease check out Kero Kero Bonito and the rest of their songs\r\nI'll be mappin more of em soon\r\n\r\nBPM 178\r\nFlamingo (Expert)\r\nShrimp (Hard)\r\n\r\nhave fun \r\n\r\ngimme feedback on Discord\r\nETAN#8341","deletedAt":null,"_id":"5cff621748229f7d88fc93fc","key":"4e6f","name":"Kero Kero Bonito - Flamingo","uploader":{"_id":"5cff0b7798cc5a672c855775","username":"etan"},"uploaded":"2019-05-22T00:46:47.000Z","hash":"585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b","directDownload":"/cdn/4e6f/585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b.zip","downloadURL":"/api/download/key/4e6f","coverURL":"/cdn/4e6f/585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":689.8004760742188,"length":242,"bombs":16,"notes":1093,"obstacles":16,"njs":14,"njsOffset":0},"expertPlus":null}}],"songName":"IGNITE","songSubName":"Aoi Eir","songAuthorName":"Joetastic","levelAuthorName":"Joetastic","bpm":171},"stats":{"downloads":266468,"plays":0,"downVotes":141,"upVotes":7933,"heat":451.3606934,"rating":0.9503730517090982},"description":"Trying to get this version ranked! New version with changes according to the ranking criteria: Double directional notes fixed, flow improvements, removed fast dodge walls on bridge section.","deletedAt":null,"_id":"5cff621248229f7d88fc7b21","key":"26f6","name":"IGNITE (Ranked Version) [Sword Art Online Season 2 Opening] - Aoi Eir","uploader":{"_id":"5cff0b7498cc5a672c85050e","username":"joetastic"},"uploaded":"2018-12-20T01:21:47.000Z","hash":"125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c","directDownload":"/cdn/26f6/125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c.zip","downloadURL":"/api/download/key/26f6","coverURL":"/cdn/26f6/125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_rating().await.unwrap();
}
#[async_test]
async fn test_maps_latest() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/latest").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":225,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":512,"length":219,"njs":20,"njsOffset":-0.550000011920929,"bombs":101,"notes":688,"obstacles":35},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"AuroraModz","songAuthorName":"Cafe Disko","songName":"So High","songSubName":"(feat. Danél)","bpm":140},"stats":{"downloads":0,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.4047171,"rating":0},"description":"Mapped By UwUCrew.\nWe are a various mapping team that makes songs based on what the community wants. If you would like to request a song join this discord>https://discord.gg/YueyEWb\n","deletedAt":null,"_id":"5fbdfabcea68e70007b216f6","key":"1149f","name":"Cafe Disko - So High (feat. Danél)","uploader":{"_id":"5f292e68c9b14c0006ce923f","username":"uwucrew"},"hash":"56941d85c66142fb91aaa62eeb36e65262343d9a","uploaded":"2020-11-25T06:33:32.268Z","directDownload":"/cdn/1149f/56941d85c66142fb91aaa62eeb36e65262343d9a.zip","downloadURL":"/api/download/key/1149f","coverURL":"/cdn/1149f/56941d85c66142fb91aaa62eeb36e65262343d9a.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":110,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":174.537,"length":58,"njs":23,"njsOffset":-0.5,"bombs":6,"notes":333,"obstacles":46},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Astrella","songAuthorName":"Breakmaster Cylinder","songName":"The Most Gangster Drop","songSubName":"","bpm":180},"stats":{"downloads":21,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3840344,"rating":0},"description":"gangster awehfiuawefluiawehfaiuwhfewaf","deletedAt":null,"_id":"5fbdf719ea68e70007b21333","key":"1149e","name":"The Most Gangster Drop - Breakmaster Cylinder","uploader":{"_id":"5fa1e74381e1d70006f2cc01","username":"c0r3nn"},"hash":"d6a267ea3d6a0d715d1d320e7773ad646aa2a424","uploaded":"2020-11-25T06:18:01.546Z","directDownload":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.zip","downloadURL":"/api/download/key/1149e","coverURL":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":239,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":243.375,"length":101,"njs":12,"njsOffset":0,"bombs":0,"notes":300,"obstacles":2},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Packz","songAuthorName":"Illenium, John Bellion","songName":"Good Things Fall Apart - Illenium, John Bellion","songSubName":"","bpm":144},"stats":{"downloads":77,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3043823,"rating":0},"description":"this is a test map dont download","deletedAt":null,"_id":"5fbde91900e48a00065ae757","key":"1149d","name":"tyui","uploader":{"_id":"5f9a3ba76ef6a20006d59aea","username":"milla"},"hash":"eb7f40e59ee44be638054b3ca41f4f4b7b5b357f","uploaded":"2020-11-25T05:18:17.204Z","directDownload":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.zip","downloadURL":"/api/download/key/1149d","coverURL":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":74,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":399,"length":106,"njs":23,"njsOffset":-0.20000000298023224,"bombs":0,"notes":931,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"DE125","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix) (Literally Just the First Drop Ver.)","bpm":225},"stats":{"downloads":91,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2910497,"rating":0},"description":"Literally just the first drop.\nI overmapped this so the pattern would work B)\n\nDm with issues @DE125#0001 if the issue isn't cringe saut burnt rice pattern","deletedAt":null,"_id":"5fbde6c1ea68e70007b20165","key":"1149c","name":"you - Melancholia (EKU's Desolation Remix) (TV Size)","uploader":{"_id":"5cff0b7798cc5a672c8554ba","username":"de125"},"hash":"2cb3a27602b362a6265fdfd543f4eec31f957ba4","uploaded":"2020-11-25T05:08:17.236Z","directDownload":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.zip","downloadURL":"/api/download/key/1149c","coverURL":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":true,"expertPlus":false,"hard":true,"normal":true},"duration":96,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":269.302083,"length":89,"njs":8,"njsOffset":0,"bombs":0,"notes":179,"obstacles":18},"expert":{"duration":269.302083,"length":89,"njs":15,"njsOffset":0,"bombs":14,"notes":403,"obstacles":112},"expertPlus":null,"hard":{"duration":269.302083,"length":89,"njs":13,"njsOffset":0,"bombs":11,"notes":360,"obstacles":102},"normal":{"duration":269.302083,"length":89,"njs":10,"njsOffset":0,"bombs":20,"notes":286,"obstacles":30}},"name":"Standard"}],"levelAuthorName":"rodysan","songAuthorName":"Ryu*","songName":"Sakura Sunrise","songSubName":"","bpm":181},"stats":{"downloads":96,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2705277,"rating":0},"description":"9","deletedAt":null,"_id":"5fbde325ea68e70007b1fd1e","key":"1149b","name":"Sakura Sunrise - Ryu☆","uploader":{"_id":"5fabfd44fe23c6000688154a","username":"rodysan"},"hash":"eea9c9813c1a06ce2ea754a4d4557f98bdc33d33","uploaded":"2020-11-25T04:52:53.745Z","directDownload":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.zip","downloadURL":"/api/download/key/1149b","coverURL":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.png"},{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":240,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":525.5,"length":233,"njs":12,"njsOffset":0,"bombs":235,"notes":1036,"obstacles":46},"hard":null,"normal":null},"name":"Standard"},{"difficulties":{"easy":{"duration":0,"length":0,"njs":16,"njsOffset":0,"bombs":0,"notes":0,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Lightshow"}],"levelAuthorName":"jd gamer65","songAuthorName":"CG5, Pokimane, TheRandomMusicMan, ect","songName":"A Killer on the floor","songSubName":"Among Us Rap Battle","bpm":135},"stats":{"downloads":116,"plays":0,"downVotes":1,"upVotes":1,"heat":1803.2316104,"rating":0.5},"description":"Made with the help of beatsage.com It is a bit choppy at bits, because i am a amateur editor. Hope you enjoy my first song I fully mapped! BTW there is a light show mode in case you wanna watch my dynamic lighting.","deletedAt":null,"_id":"5fbddc4ee3a5a20006f9bfb0","key":"11493","name":"Killer on the Floor, Among Us Rap Battle ","uploader":{"_id":"5f03f3fb8f03870006ab590f","username":"jd gamer65"},"hash":"6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26","uploaded":"2020-11-25T04:23:42.467Z","directDownload":"/cdn/11493/6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26.zip","downloadURL":"/api/download/key/11493","coverURL":"/cdn/11493/6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":49,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":203.5,"length":46,"njs":26,"njsOffset":-0.05000000074505806,"bombs":121,"notes":506,"obstacles":5},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"MonsterWook regrets this","songAuthorName":"Nickelodeon","songName":"FanBoy & ChumChum Theme Song","songSubName":"","bpm":260.0740051269531},"stats":{"downloads":112,"plays":0,"downVotes":0,"upVotes":1,"heat":1803.2228074,"rating":0.5941636475090435},"description":"BA BAB ABA ABA BA AB ABA BA BA ABB A ABA A BA BAB ABABAB ABB BRAIN FREEEZEEEEEE BABA BBBABABABBABABAB","deletedAt":null,"_id":"5fbddac2ea68e70007b1f529","key":"11492","name":"yes hahaha - FanBoy & ChumChum Theme Song","uploader":{"_id":"5e3e058b470a82000675dc55","username":"monsterwook2"},"hash":"b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb","uploaded":"2020-11-25T04:17:06.334Z","directDownload":"/cdn/11492/b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb.zip","downloadURL":"/api/download/key/11492","coverURL":"/cdn/11492/b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":false,"hard":true,"normal":true},"duration":235,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":null,"hard":{"duration":388,"length":232,"njs":14,"njsOffset":0,"bombs":0,"notes":874,"obstacles":9},"normal":{"duration":381.25,"length":228,"njs":12,"njsOffset":0,"bombs":60,"notes":374,"obstacles":52}},"name":"Standard"}],"levelAuthorName":"Alekcake","songAuthorName":"Amerie","songName":"1 Thing","songSubName":"","bpm":100},"stats":{"downloads":103,"plays":0,"downVotes":0,"upVotes":1,"heat":1803.2192485,"rating":0.5941636475090435},"description":"Special request :D\r\n\r\nGet in touch with us on our discord server!\r\nAlekcake's Kpop & VR Arcade - https://discord.gg/P4eGh26","deletedAt":null,"_id":"5fbdda22910759000612f575","key":"11490","name":"Amerie - 1 Thing","uploader":{"_id":"5ee6cc499ae7380006da7aef","username":"alekcake"},"hash":"5e4f00d81ef0363439c712c64f35dfea017918f9","uploaded":"2020-11-25T04:14:26.181Z","directDownload":"/cdn/11490/5e4f00d81ef0363439c712c64f35dfea017918f9.zip","downloadURL":"/api/download/key/11490","coverURL":"/cdn/11490/5e4f00d81ef0363439c712c64f35dfea017918f9.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":191,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":316,"length":184,"njs":18,"njsOffset":1,"bombs":0,"notes":935,"obstacles":94},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"MisterZ did it","songAuthorName":"LINKIN PARK","songName":"Pushing Me Away","songSubName":"","bpm":103},"stats":{"downloads":112,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.203822,"rating":0},"description":"","deletedAt":null,"_id":"5fbdd76b5fd85f00069233d5","key":"1148e","name":"Pushing Me Away","uploader":{"_id":"5f52d68f9824150006c5a23b","username":"misterz did it"},"hash":"fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2","uploaded":"2020-11-25T04:02:51.989Z","directDownload":"/cdn/1148e/fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2.zip","downloadURL":"/api/download/key/1148e","coverURL":"/cdn/1148e/fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":350,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":1264.1478271484375,"length":337,"njs":22,"njsOffset":-0.28999999165534973,"bombs":9,"notes":2553,"obstacles":250},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"abcbadq","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix)","bpm":225},"stats":{"downloads":122,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.1947261,"rating":0},"description":"crow walls thats all you need to know\nrequested by saints","deletedAt":null,"_id":"5fbdd5d239a7430006a0485d","key":"1148c","name":"Melancholia (EKU's Desolation Remix)","uploader":{"_id":"5e0344ebe85d6800061edc97","username":"abcbadq"},"hash":"94e516fab1650261b372ee83f51a9fe5fa6b2908","uploaded":"2020-11-25T03:56:02.673Z","directDownload":"/cdn/1148c/94e516fab1650261b372ee83f51a9fe5fa6b2908.zip","downloadURL":"/api/download/key/1148c","coverURL":"/cdn/1148c/94e516fab1650261b372ee83f51a9fe5fa6b2908.png"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_latest().await.unwrap();
}
#[async_test]
async fn test_maps_downloads() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/downloads").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":468,"length":212,"bombs":4,"notes":415,"obstacles":42,"njs":10,"njsOffset":0},"hard":{"duration":468,"length":212,"bombs":40,"notes":695,"obstacles":94,"njs":10,"njsOffset":0},"expert":{"duration":468,"length":212,"bombs":50,"notes":932,"obstacles":103,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Gangnam Style","songSubName":"PSY","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":132},"stats":{"downloads":1069206,"plays":82700,"downVotes":617,"upVotes":17445,"heat":41.5047436,"rating":0.94147214608232},"description":"Expert, Hard, and Normal tracks. I tried my best to setup the chorus charts to allow you to mimic the classic dance moves. I think it matches up quite nicely. I hope you have as much fun playing as I did making this! Enjoy!","deletedAt":null,"_id":"5cff620c48229f7d88fc620d","key":"141","name":"GANGNAM STYLE","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-05-20T09:59:02.000Z","hash":"8e7e553099436af31564adf1977a5ec42a61cfff","directDownload":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.zip","downloadURL":"/api/download/key/141","coverURL":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":418,"length":200,"bombs":0,"notes":546,"obstacles":10,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Believer","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":1045930,"plays":70725,"downVotes":352,"upVotes":9390,"heat":18.911539,"rating":0.9346479331024395},"description":"Currently expert only. Events included.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e9","key":"b","name":"Imagine Dragons - Believer","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-05-08T18:56:36.000Z","hash":"19f2879d11a91b51a5c090d63471c3e8d9b7aee3","directDownload":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.zip","downloadURL":"/api/download/key/b","coverURL":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":328.556396484375,"length":142,"bombs":0,"notes":188,"obstacles":84,"njs":10,"njsOffset":0},"normal":{"duration":328.681396484375,"length":142,"bombs":40,"notes":219,"obstacles":70,"njs":10,"njsOffset":0},"hard":{"duration":328.681396484375,"length":142,"bombs":42,"notes":386,"obstacles":72,"njs":10,"njsOffset":0},"expert":{"duration":328.681396484375,"length":142,"bombs":46,"notes":623,"obstacles":69,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Beat it","songSubName":"Michael Jackson","songAuthorName":"Freeek","levelAuthorName":"freeek","bpm":139},"stats":{"downloads":941091,"plays":117624,"downVotes":768,"upVotes":12584,"heat":51.2995594,"rating":0.9171309232285056},"description":"Easy/Normal/Hard/Expert - Obstacles and mines purely for dance moves! 100% Expert Playthrough: https://bit.ly/2IKzCp3\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62d6","key":"217","name":"Beat it - Michael Jackson","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T14:20:19.000Z","hash":"4b2da842b687ec4cfbc948c583c21c79d4120de0","directDownload":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.zip","downloadURL":"/api/download/key/217","coverURL":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":640.7428588867188,"length":311,"bombs":57,"notes":423,"obstacles":33,"njs":10,"njsOffset":0},"expert":{"duration":640.7428588867188,"length":311,"bombs":68,"notes":616,"obstacles":33,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Harder Better Faster Stronger","songSubName":"Daft Punk","songAuthorName":"RunRockGame","levelAuthorName":"runrockgame","bpm":123},"stats":{"downloads":939245,"plays":74223,"downVotes":761,"upVotes":13105,"heat":65.0537892,"rating":0.9199051796117618},"description":"Expert & Hard | 600+ Blocks | Full Song 3:44 | Includes Lighting. Request to: @themakertales","deletedAt":null,"_id":"5cff620c48229f7d88fc63dd","key":"32e","name":"Daft Punk - Harder Better Faster Stronger","uploader":{"_id":"5cff0b7398cc5a672c84f04e","username":"runrockgame"},"uploaded":"2018-06-01T18:01:45.000Z","hash":"7c7f38d467bb43fe11a142581e63e324622ecc71","directDownload":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.zip","downloadURL":"/api/download/key/32e","coverURL":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":623.3125,"length":214,"bombs":0,"notes":462,"obstacles":25,"njs":10,"njsOffset":0},"hard":{"duration":623.3125,"length":214,"bombs":0,"notes":639,"obstacles":40,"njs":10,"njsOffset":0},"expert":{"duration":623.3125,"length":214,"bombs":0,"notes":825,"obstacles":40,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Mr. Blue Sky","songSubName":"Electric Light Orchestra","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":174},"stats":{"downloads":929040,"plays":39426,"downVotes":485,"upVotes":22691,"heat":94.0178926,"rating":0.9558250129688451},"description":"Channel your inner Baby Groot. Normal, Hard, Expert\r\nSpecial thanks to BennydaBeast for his help on this track!","deletedAt":null,"_id":"5cff620d48229f7d88fc65f7","key":"570","name":"Mr. Blue Sky | Electric Light Orchestra","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-06-16T16:53:34.000Z","hash":"236173d5ba7dc379d480b9cb5fb6b4fa5abe77da","directDownload":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.zip","downloadURL":"/api/download/key/570","coverURL":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":590.65625,"length":232,"bombs":0,"notes":768,"obstacles":154,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Rasputin (Funk Overload)","songSubName":"","songAuthorName":"Jobas","levelAuthorName":"jobas","bpm":149},"stats":{"downloads":796456,"plays":29624,"downVotes":774,"upVotes":17434,"heat":40.1104306,"rating":0.9336181107580133},"description":"Hard\r\nBpm 147\r\nspeed up version of rasputin Original","deletedAt":null,"_id":"5cff620c48229f7d88fc61f0","key":"124","name":"Rasputin (Funk Overload)","uploader":{"_id":"5cff0b7298cc5a672c84e9a2","username":"jobas"},"uploaded":"2018-05-19T16:36:34.000Z","hash":"9a1d001995cc0a2014352aa7148cbcbf2e489d89","directDownload":"/cdn/124/9a1d001995cc0a2014352aa7148cbcbf2e489d89.zip","downloadURL":"/api/download/key/124","coverURL":"/cdn/124/9a1d001995cc0a2014352aa7148cbcbf2e489d89.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":473.1875,"length":228,"bombs":0,"notes":399,"obstacles":0,"njs":10,"njsOffset":0},"hard":{"duration":473.1875,"length":228,"bombs":0,"notes":496,"obstacles":0,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Seven Nation Army","songSubName":"The White Stripes","songAuthorName":"BlueASIS","levelAuthorName":"blueasis","bpm":124},"stats":{"downloads":776038,"plays":56470,"downVotes":437,"upVotes":11620,"heat":74.676625,"rating":0.93635850868144},"description":"UPDATED! @BlueASIS#4095 on Discord let me know what you think","deletedAt":null,"_id":"5cff620d48229f7d88fc64a0","key":"3fc","name":"The White Stripes - Seven Nation Army","uploader":{"_id":"5cff0b7298cc5a672c84eb5d","username":"blueasis"},"uploaded":"2018-06-06T18:51:03.000Z","hash":"0b0ad0f34b2d0687a9794bcf5019100fda06971e","directDownload":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.zip","downloadURL":"/api/download/key/3fc","coverURL":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":384,"length":136,"bombs":0,"notes":505,"obstacles":52,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Take On Me","songSubName":"","songAuthorName":"a-ha","levelAuthorName":"jackscape","bpm":168},"stats":{"downloads":770057,"plays":36801,"downVotes":549,"upVotes":5946,"heat":18.5911969,"rating":0.8859054068140281},"description":"Expert only","deletedAt":null,"_id":"5cff620c48229f7d88fc60e7","key":"9","name":"a-ha - Take On Me","uploader":{"_id":"5cff0b7298cc5a672c84e8bb","username":"jackscape"},"uploaded":"2018-05-08T17:44:17.000Z","hash":"2aa1f5192828e075c30dd015b1e132bba912eb86","directDownload":"/cdn/9/2aa1f5192828e075c30dd015b1e132bba912eb86.zip","downloadURL":"/api/download/key/9","coverURL":"/cdn/9/2aa1f5192828e075c30dd015b1e132bba912eb86.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":342.8125,"length":165,"bombs":0,"notes":313,"obstacles":27,"njs":10,"njsOffset":0},"normal":{"duration":343.8125,"length":166,"bombs":0,"notes":480,"obstacles":27,"njs":10,"njsOffset":0},"hard":{"duration":343.8125,"length":166,"bombs":0,"notes":730,"obstacles":27,"njs":10,"njsOffset":0},"expert":{"duration":341.75,"length":165,"bombs":11,"notes":735,"obstacles":2,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Lone Digger","songSubName":"","songAuthorName":"Caravan Palace","levelAuthorName":"calijor","bpm":124},"stats":{"downloads":677450,"plays":57999,"downVotes":823,"upVotes":14212,"heat":46.3871704,"rating":0.920647601959446},"description":"Caravan Palace - Lone Digger\r\nEasy | Normal | Hard | Expert\r\nThis is a re-upload of my previous map, with improvements for hard, and a new, harder expert difficulty mapped by Squeaksies, as well as lower difficulties as iterations on my original map.\r\n\r\nBPM: 124\r\nDuration: 2:49\r\nNotes (Hard): 730\r\nNotes (Expert): 735\r\nPreview (Hard): https://youtu.be/NExvLUyeBUU\r\nPreview (Expert): https://youtu.be/NYmExXlpB0k","deletedAt":null,"_id":"5cff620c48229f7d88fc6282","key":"1bf","name":"Caravan Palace - Lone Digger","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-23T00:15:19.000Z","hash":"906160fd1f808e2f34f33c2ca5920118855c065d","directDownload":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.zip","downloadURL":"/api/download/key/1bf","coverURL":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":382.4375,"length":246,"bombs":0,"notes":728,"obstacles":16,"njs":10,"njsOffset":0},"hard":{"duration":387.4375,"length":249,"bombs":0,"notes":836,"obstacles":19,"njs":10,"njsOffset":0},"expert":{"duration":387.4375,"length":249,"bombs":0,"notes":883,"obstacles":31,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Africa","songSubName":"","songAuthorName":"Toto","levelAuthorName":"calijor","bpm":92},"stats":{"downloads":669322,"plays":27043,"downVotes":1106,"upVotes":5060,"heat":40.3054811,"rating":0.7974511907115919},"description":"Bless the rains!\r\n\r\nExpert, hard, and normal difficulty available. I do apologize, but I think they're a bit harder than vanilla.\r\n\r\nBPM: 92\r\nNotes: 883 (expert)\r\nDuration: 4:20\r\n\r\nPreview: https://youtu.be/SLpUwKson80","deletedAt":null,"_id":"5cff620c48229f7d88fc6203","key":"137","name":"Toto - Africa","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-20T02:51:20.000Z","hash":"12fee98db7d2080724435d0a1442545f21a9134d","directDownload":"/cdn/137/12fee98db7d2080724435d0a1442545f21a9134d.zip","downloadURL":"/api/download/key/137","coverURL":"/cdn/137/12fee98db7d2080724435d0a1442545f21a9134d.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_downloads().await.unwrap();
}
#[async_test]
async fn test_maps_plays() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/plays").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":328.556396484375,"length":142,"bombs":0,"notes":188,"obstacles":84,"njs":10,"njsOffset":0},"normal":{"duration":328.681396484375,"length":142,"bombs":40,"notes":219,"obstacles":70,"njs":10,"njsOffset":0},"hard":{"duration":328.681396484375,"length":142,"bombs":42,"notes":386,"obstacles":72,"njs":10,"njsOffset":0},"expert":{"duration":328.681396484375,"length":142,"bombs":46,"notes":623,"obstacles":69,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Beat it","songSubName":"Michael Jackson","songAuthorName":"Freeek","levelAuthorName":"freeek","bpm":139},"stats":{"downloads":941091,"plays":117624,"downVotes":768,"upVotes":12584,"heat":51.2995594,"rating":0.9171309232285056},"description":"Easy/Normal/Hard/Expert - Obstacles and mines purely for dance moves! 100% Expert Playthrough: https://bit.ly/2IKzCp3\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62d6","key":"217","name":"Beat it - Michael Jackson","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T14:20:19.000Z","hash":"4b2da842b687ec4cfbc948c583c21c79d4120de0","directDownload":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.zip","downloadURL":"/api/download/key/217","coverURL":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":468,"length":212,"bombs":4,"notes":415,"obstacles":42,"njs":10,"njsOffset":0},"hard":{"duration":468,"length":212,"bombs":40,"notes":695,"obstacles":94,"njs":10,"njsOffset":0},"expert":{"duration":468,"length":212,"bombs":50,"notes":932,"obstacles":103,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Gangnam Style","songSubName":"PSY","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":132},"stats":{"downloads":1069207,"plays":82700,"downVotes":617,"upVotes":17445,"heat":41.5047436,"rating":0.94147214608232},"description":"Expert, Hard, and Normal tracks. I tried my best to setup the chorus charts to allow you to mimic the classic dance moves. I think it matches up quite nicely. I hope you have as much fun playing as I did making this! Enjoy!","deletedAt":null,"_id":"5cff620c48229f7d88fc620d","key":"141","name":"GANGNAM STYLE","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-05-20T09:59:02.000Z","hash":"8e7e553099436af31564adf1977a5ec42a61cfff","directDownload":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.zip","downloadURL":"/api/download/key/141","coverURL":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":640.7428588867188,"length":311,"bombs":57,"notes":423,"obstacles":33,"njs":10,"njsOffset":0},"expert":{"duration":640.7428588867188,"length":311,"bombs":68,"notes":616,"obstacles":33,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Harder Better Faster Stronger","songSubName":"Daft Punk","songAuthorName":"RunRockGame","levelAuthorName":"runrockgame","bpm":123},"stats":{"downloads":939245,"plays":74223,"downVotes":761,"upVotes":13105,"heat":65.0537892,"rating":0.9199051796117618},"description":"Expert & Hard | 600+ Blocks | Full Song 3:44 | Includes Lighting. Request to: @themakertales","deletedAt":null,"_id":"5cff620c48229f7d88fc63dd","key":"32e","name":"Daft Punk - Harder Better Faster Stronger","uploader":{"_id":"5cff0b7398cc5a672c84f04e","username":"runrockgame"},"uploaded":"2018-06-01T18:01:45.000Z","hash":"7c7f38d467bb43fe11a142581e63e324622ecc71","directDownload":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.zip","downloadURL":"/api/download/key/32e","coverURL":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":418,"length":200,"bombs":0,"notes":546,"obstacles":10,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Believer","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":1045930,"plays":70725,"downVotes":352,"upVotes":9390,"heat":18.911539,"rating":0.9346479331024395},"description":"Currently expert only. Events included.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e9","key":"b","name":"Imagine Dragons - Believer","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-05-08T18:56:36.000Z","hash":"19f2879d11a91b51a5c090d63471c3e8d9b7aee3","directDownload":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.zip","downloadURL":"/api/download/key/b","coverURL":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":342.8125,"length":165,"bombs":0,"notes":313,"obstacles":27,"njs":10,"njsOffset":0},"normal":{"duration":343.8125,"length":166,"bombs":0,"notes":480,"obstacles":27,"njs":10,"njsOffset":0},"hard":{"duration":343.8125,"length":166,"bombs":0,"notes":730,"obstacles":27,"njs":10,"njsOffset":0},"expert":{"duration":341.75,"length":165,"bombs":11,"notes":735,"obstacles":2,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Lone Digger","songSubName":"","songAuthorName":"Caravan Palace","levelAuthorName":"calijor","bpm":124},"stats":{"downloads":677451,"plays":57999,"downVotes":823,"upVotes":14212,"heat":46.3871704,"rating":0.920647601959446},"description":"Caravan Palace - Lone Digger\r\nEasy | Normal | Hard | Expert\r\nThis is a re-upload of my previous map, with improvements for hard, and a new, harder expert difficulty mapped by Squeaksies, as well as lower difficulties as iterations on my original map.\r\n\r\nBPM: 124\r\nDuration: 2:49\r\nNotes (Hard): 730\r\nNotes (Expert): 735\r\nPreview (Hard): https://youtu.be/NExvLUyeBUU\r\nPreview (Expert): https://youtu.be/NYmExXlpB0k","deletedAt":null,"_id":"5cff620c48229f7d88fc6282","key":"1bf","name":"Caravan Palace - Lone Digger","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-23T00:15:19.000Z","hash":"906160fd1f808e2f34f33c2ca5920118855c065d","directDownload":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.zip","downloadURL":"/api/download/key/1bf","coverURL":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":473.1875,"length":228,"bombs":0,"notes":399,"obstacles":0,"njs":10,"njsOffset":0},"hard":{"duration":473.1875,"length":228,"bombs":0,"notes":496,"obstacles":0,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Seven Nation Army","songSubName":"The White Stripes","songAuthorName":"BlueASIS","levelAuthorName":"blueasis","bpm":124},"stats":{"downloads":776038,"plays":56470,"downVotes":437,"upVotes":11620,"heat":74.676625,"rating":0.93635850868144},"description":"UPDATED! @BlueASIS#4095 on Discord let me know what you think","deletedAt":null,"_id":"5cff620d48229f7d88fc64a0","key":"3fc","name":"The White Stripes - Seven Nation Army","uploader":{"_id":"5cff0b7298cc5a672c84eb5d","username":"blueasis"},"uploaded":"2018-06-06T18:51:03.000Z","hash":"0b0ad0f34b2d0687a9794bcf5019100fda06971e","directDownload":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.zip","downloadURL":"/api/download/key/3fc","coverURL":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":183.5,"length":81,"bombs":0,"notes":174,"obstacles":0,"njs":10,"njsOffset":0},"expert":{"duration":183.5,"length":81,"bombs":0,"notes":262,"obstacles":0,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Unravel","songSubName":"(TV Size)","songAuthorName":"TK","levelAuthorName":"winepic","bpm":135},"stats":{"downloads":444166,"plays":52247,"downVotes":369,"upVotes":4150,"heat":18.3311622,"rating":0.8851378895668524},"description":"Map made by me. Includes Hard and Expert difficulties.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e5","key":"7","name":"Unravel (Tokyo Ghoul OP) TV Size","uploader":{"_id":"5cff0b7298cc5a672c84e8b6","username":"winepic"},"uploaded":"2018-05-08T16:25:10.000Z","hash":"b9867cdccf8b27d7a174c861adc69215c86cdab8","directDownload":"/cdn/7/b9867cdccf8b27d7a174c861adc69215c86cdab8.zip","downloadURL":"/api/download/key/7","coverURL":"/cdn/7/b9867cdccf8b27d7a174c861adc69215c86cdab8.png"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":265.510009765625,"length":189,"bombs":0,"notes":297,"obstacles":57,"njs":10,"njsOffset":0},"normal":{"duration":264.510009765625,"length":188,"bombs":0,"notes":358,"obstacles":62,"njs":10,"njsOffset":0},"hard":{"duration":266.010009765625,"length":190,"bombs":0,"notes":514,"obstacles":67,"njs":10,"njsOffset":0},"expert":{"duration":276.010009765625,"length":197,"bombs":0,"notes":681,"obstacles":67,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Clint Eastwood","songSubName":"Gorillaz","songAuthorName":"unknow","levelAuthorName":"freeek","bpm":84},"stats":{"downloads":471361,"plays":51819,"downVotes":372,"upVotes":5758,"heat":51.4893997,"rating":0.9075010599167767},"description":"Easy/Normal/Hard/Expert - Audio is as loud without clipping I swear! 100% Expert Playthrough: https://bit.ly/2LuFcxq\r\n\r\nHave fun! =D\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62e4","key":"225","name":"Clint Eastwood - Gorillaz","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T20:58:36.000Z","hash":"507f0e09326d37e09dca08e3c2597f027dbe1940","directDownload":"/cdn/225/507f0e09326d37e09dca08e3c2597f027dbe1940.zip","downloadURL":"/api/download/key/225","coverURL":"/cdn/225/507f0e09326d37e09dca08e3c2597f027dbe1940.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":189,"length":90,"bombs":0,"notes":330,"obstacles":0,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Super Mario Bros. Theme (Overworld Theme)","songSubName":"Nintendo","songAuthorName":"red knight","levelAuthorName":"redknight","bpm":125},"stats":{"downloads":552611,"plays":49329,"downVotes":1093,"upVotes":4653,"heat":22.15705,"rating":0.7869063116417228},"description":"Expert only","deletedAt":null,"_id":"5cff620c48229f7d88fc6106","key":"29","name":"Super Mario Bros Theme","uploader":{"_id":"5cff0b7298cc5a672c84e917","username":"redknight"},"uploaded":"2018-05-10T16:34:12.000Z","hash":"c1c8e2b9394050afad435608137941da0b64b8f3","directDownload":"/cdn/29/c1c8e2b9394050afad435608137941da0b64b8f3.zip","downloadURL":"/api/download/key/29","coverURL":"/cdn/29/c1c8e2b9394050afad435608137941da0b64b8f3.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":472.5,"length":232,"bombs":0,"notes":373,"obstacles":11,"njs":10,"njsOffset":0},"hard":{"duration":472.5,"length":232,"bombs":0,"notes":503,"obstacles":14,"njs":10,"njsOffset":0},"expert":{"duration":472.5,"length":232,"bombs":0,"notes":682,"obstacles":30,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Livin' On A Prayer","songSubName":"Bon Jovi","songAuthorName":"Bon Jovi","levelAuthorName":"jnua12345","bpm":122},"stats":{"downloads":472998,"plays":47593,"downVotes":840,"upVotes":2606,"heat":34.0630574,"rating":0.7341707864621012},"description":"Expert, Hard, Normal 122BPM","deletedAt":null,"_id":"5cff620c48229f7d88fc6194","key":"bd","name":"Bon Jovi - Livin' On A Prayer","uploader":{"_id":"5cff0b7298cc5a672c84e9da","username":"jnua12345"},"uploaded":"2018-05-17T01:12:03.000Z","hash":"4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88","directDownload":"/cdn/bd/4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88.zip","downloadURL":"/api/download/key/bd","coverURL":"/cdn/bd/4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_plays().await.unwrap();
}
#[async_test]
async fn test_user() {
let client = FakeClient::new(
BEATSAVER_URL
.join("api/users/find/5fbe7cd60192c700062b2a1f")
.unwrap(),
r#"{"_id":"5fbe7cd60192c700062b2a1f","username":"qw3rty01"}"#.into(),
);
client
.user("5fbe7cd60192c700062b2a1f".to_string())
.await
.unwrap();
}
#[async_test]
async fn test_search() {
let client = FakeClient::new(BEATSAVER_URL.join("api/search/text?q=datkami").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86172,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273593,"plays":31684,"downVotes":178,"upVotes":4248,"heat":21.0823944,"rating":0.923057857514794},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21773,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40640,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client.search("datkami".to_string()).await.unwrap();
}
#[async_test]
async fn test_search_advanced() {
let client = FakeClient::new(BEATSAVER_URL.join("api/search/advanced?q=metadata.levelAuthor%3Adatkami").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86172,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273593,"plays":31684,"downVotes":178,"upVotes":4248,"heat":21.0823944,"rating":0.923057857514794},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21773,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40640,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client
.search_advanced("metadata.levelAuthor:datkami".to_string())
.await
.unwrap();
}
#[async_test]
async fn test_download() {
let client = FakeClient::new(
BEATSAVER_URL.join("api/download/key/1").unwrap(),
"map #1".into(),
);
client.download("1".try_into().unwrap()).await.unwrap();
let client = FakeClient::new(
BEATSAVER_URL
.join("api/download/hash/fda568fc27c20d21f8dc6f3709b49b5cc96723be")
.unwrap(),
"map #1".into(),
);
client
.download(
"fda568fc27c20d21f8dc6f3709b49b5cc96723be"
.try_into()
.unwrap(),
)
.await
.unwrap();
}
}
#[cfg(feature = "tokio")]
mod tokio_tests {
use crate::tests::FakeClient;
use crate::BEATSAVER_URL;
use crate::{BeatSaverApiAsync, BeatSaverUser};
use std::convert::TryInto;
use tokio::test as async_test;
#[async_test]
async fn test_map() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/detail/1").unwrap(), r#"{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}"#.into());
client
.map(&"1".to_string().try_into().unwrap())
.await
.unwrap();
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/by-hash/fda568fc27c20d21f8dc6f3709b49b5cc96723be").unwrap(), r#"{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}"#.into());
client
.map(
&"fda568fc27c20d21f8dc6f3709b49b5cc96723be"
.to_string()
.try_into()
.unwrap(),
)
.await
.unwrap();
}
#[async_test]
async fn test_maps_by() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/uploader/5cff0b7298cc5a672c84e8a3").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40619,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21772,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273492,"plays":31684,"downVotes":177,"upVotes":4246,"heat":21.0822877,"rating":0.9232332918273986},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86164,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client
.maps_by(&BeatSaverUser {
id: "5cff0b7298cc5a672c84e8a3".to_string(),
username: "datkami".to_string(),
})
.await
.unwrap();
}
#[async_test]
async fn test_maps_hot() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/hot").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":false,"hard":false,"normal":false},"duration":13,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":13.625,"length":11,"njs":18,"njsOffset":1,"bombs":0,"notes":25,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Lawless"}],"levelAuthorName":"Chief Queef","songAuthorName":" ","songName":"*teleports behind you*","songSubName":"","bpm":69},"stats":{"downloads":494,"plays":0,"downVotes":0,"upVotes":10,"heat":1803.8752302,"rating":0.7570708845427101},"description":"nothing personnel kid","deletedAt":null,"_id":"5fbd9da95fd85f000691e895","key":"1146c","name":"*teleports behind you*","uploader":{"_id":"5f9a4d2a030219000627c2bf","username":"chief queef"},"hash":"4447287810e6ad338f379677c9d383b1634d876d","uploaded":"2020-11-24T23:56:25.360Z","directDownload":"/cdn/1146c/4447287810e6ad338f379677c9d383b1634d876d.zip","downloadURL":"/api/download/key/1146c","coverURL":"/cdn/1146c/4447287810e6ad338f379677c9d383b1634d876d.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":true,"hard":false,"normal":false},"duration":225,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":312.15301513671875,"length":208,"njs":16,"njsOffset":-0.4000000059604645,"bombs":12,"notes":551,"obstacles":194},"expertPlus":{"duration":312.15301513671875,"length":208,"njs":16,"njsOffset":-0.4000000059604645,"bombs":12,"notes":564,"obstacles":220},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"AmpereBEEP","songAuthorName":"Madeon","songName":"Home","songSubName":"","bpm":90},"stats":{"downloads":513,"plays":0,"downVotes":2,"upVotes":8,"heat":1803.5866947,"rating":0.6542425307256261},"description":"Really? No maps of this song before? That's a surprise.\r\n\r\nThis song is nice and slow and the map fits it accordingly. Could be good for accuracy practice or just a good map for newer players to see some good flow. \r\n\r\nMap comes with 2 difficulties: Expert+ with 564 notes at 2.50 notes per second, and a slightly less difficult Expert with 551 notes at 2.44 notes per second. Both maps are nearly identical, with the Expert+ difficulty having dodge walls and a section that might be a little difficult to read for new players.\r\n\r\nIf you have any feedback or any suggestions, send it to AmpereBEEP#1723 on Discord.","deletedAt":null,"_id":"5fbd91f000e48a00065a7826","key":"11467","name":"Home - Madeon","uploader":{"_id":"5ed1475c9ae7380006c6f245","username":"amperebeep"},"hash":"059a919433c73ebf299b32ec351b60adf50add89","uploaded":"2020-11-24T23:06:24.457Z","directDownload":"/cdn/11467/059a919433c73ebf299b32ec351b60adf50add89.zip","downloadURL":"/api/download/key/11467","coverURL":"/cdn/11467/059a919433c73ebf299b32ec351b60adf50add89.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":152,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":287.7916564941406,"length":150,"njs":18,"njsOffset":-0.30000001192092896,"bombs":0,"notes":763,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"EPG7ENS","songAuthorName":"MACROSS 82-99","songName":"89.22 FM","songSubName":"","bpm":115},"stats":{"downloads":680,"plays":0,"downVotes":0,"upVotes":9,"heat":1803.4551916,"rating":0.75},"description":"i'm kinda into japanese city pop rn\nenjoy ;)","deletedAt":null,"_id":"5fbd5bde5fd85f00069186b4","key":"11435","name":"82.99 MACROSS 82-99","uploader":{"_id":"5cff0b7798cc5a672c855bb6","username":"epg7ens"},"hash":"7555522308b9ed339a03ea574dd0b298d323349f","uploaded":"2020-11-24T19:15:42.711Z","directDownload":"/cdn/11435/7555522308b9ed339a03ea574dd0b298d323349f.zip","downloadURL":"/api/download/key/11435","coverURL":"/cdn/11435/7555522308b9ed339a03ea574dd0b298d323349f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":317,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":904.8702392578125,"length":313,"njs":20,"njsOffset":-0.3199999928474426,"bombs":0,"notes":1914,"obstacles":116},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"EOP Glacier","songAuthorName":"Hatsuki Yura","songName":"Drivi'n Greedy","songSubName":"Nhato Remix","bpm":173},"stats":{"downloads":330,"plays":0,"downVotes":0,"upVotes":3,"heat":1803.443705,"rating":0.6705937099936721},"description":"This has been in my WIP folder for months but it's finally finished\n\nSong Stats:\nTop/Middle/Bottom Split:\n10%/32%/57%\nNPS: 6.02\nLights: 4,191","deletedAt":null,"_id":"5fbdadb8e3a5a20006f981d6","key":"11482","name":"Hatsuki Yura - Drivi'n Greedy","uploader":{"_id":"5d50e360adb1a20006305ca0","username":"eop glacier"},"hash":"2d000f27e4bf8a591f16cdd5322279186492b3ea","uploaded":"2020-11-25T01:04:56.269Z","directDownload":"/cdn/11482/2d000f27e4bf8a591f16cdd5322279186492b3ea.zip","downloadURL":"/api/download/key/11482","coverURL":"/cdn/11482/2d000f27e4bf8a591f16cdd5322279186492b3ea.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":110,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":174.537,"length":58,"njs":23,"njsOffset":-0.5,"bombs":6,"notes":333,"obstacles":46},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Astrella","songAuthorName":"Breakmaster Cylinder","songName":"The Most Gangster Drop","songSubName":"","bpm":180},"stats":{"downloads":16,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3840344,"rating":0},"description":"gangster awehfiuawefluiawehfaiuwhfewaf","deletedAt":null,"_id":"5fbdf719ea68e70007b21333","key":"1149e","name":"The Most Gangster Drop - Breakmaster Cylinder","uploader":{"_id":"5fa1e74381e1d70006f2cc01","username":"c0r3nn"},"hash":"d6a267ea3d6a0d715d1d320e7773ad646aa2a424","uploaded":"2020-11-25T06:18:01.546Z","directDownload":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.zip","downloadURL":"/api/download/key/1149e","coverURL":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":239,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":243.375,"length":101,"njs":12,"njsOffset":0,"bombs":0,"notes":300,"obstacles":2},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Packz","songAuthorName":"Illenium, John Bellion","songName":"Good Things Fall Apart - Illenium, John Bellion","songSubName":"","bpm":144},"stats":{"downloads":74,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3043823,"rating":0},"description":"this is a test map dont download","deletedAt":null,"_id":"5fbde91900e48a00065ae757","key":"1149d","name":"tyui","uploader":{"_id":"5f9a3ba76ef6a20006d59aea","username":"milla"},"hash":"eb7f40e59ee44be638054b3ca41f4f4b7b5b357f","uploaded":"2020-11-25T05:18:17.204Z","directDownload":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.zip","downloadURL":"/api/download/key/1149d","coverURL":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":254,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":567.219970703125,"length":243,"njs":21,"njsOffset":0.20000000298023224,"bombs":0,"notes":1253,"obstacles":7},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"night","songAuthorName":"Coheed and Cambria","songName":"Unheavenly Creatures","songSubName":"","bpm":140},"stats":{"downloads":409,"plays":0,"downVotes":0,"upVotes":3,"heat":1803.2977382,"rating":0.6705937099936721},"description":"Had fun mapping this one :)\nSend Feedback on Discord: night#0101","deletedAt":null,"_id":"5fbd940f9107590006129976","key":"1146a","name":"Coheed and Cambria - Unheavenly Creatures","uploader":{"_id":"5e244b8c003ea300067e67eb","username":"night"},"hash":"708d4a5c44c45a57d636b21c531cddde71674302","uploaded":"2020-11-24T23:15:27.762Z","directDownload":"/cdn/1146a/708d4a5c44c45a57d636b21c531cddde71674302.zip","downloadURL":"/api/download/key/1146a","coverURL":"/cdn/1146a/708d4a5c44c45a57d636b21c531cddde71674302.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":74,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":399,"length":106,"njs":23,"njsOffset":-0.20000000298023224,"bombs":0,"notes":931,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"DE125","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix) (Literally Just the First Drop Ver.)","bpm":225},"stats":{"downloads":85,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2910497,"rating":0},"description":"Literally just the first drop.\nI overmapped this so the pattern would work B)\n\nDm with issues @DE125#0001 if the issue isn't cringe saut burnt rice pattern","deletedAt":null,"_id":"5fbde6c1ea68e70007b20165","key":"1149c","name":"you - Melancholia (EKU's Desolation Remix) (TV Size)","uploader":{"_id":"5cff0b7798cc5a672c8554ba","username":"de125"},"hash":"2cb3a27602b362a6265fdfd543f4eec31f957ba4","uploaded":"2020-11-25T05:08:17.236Z","directDownload":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.zip","downloadURL":"/api/download/key/1149c","coverURL":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":false,"hard":false,"normal":false},"duration":6,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":15.5,"length":5,"njs":18,"njsOffset":0,"bombs":0,"notes":6,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Reddek","songAuthorName":"G","songName":"I like your cock G","songSubName":"","bpm":157.1999969482422},"stats":{"downloads":585,"plays":0,"downVotes":0,"upVotes":5,"heat":1803.273026,"rating":0.7084432256108616},"description":"why not","deletedAt":null,"_id":"5fbd68b800e48a00065a3663","key":"11445","name":"I like your cock G","uploader":{"_id":"5dbfb4426dea0b0006bd328d","username":"reddek"},"hash":"d3be6bc67cda1f13b3ac91c6b98d90605153f7f9","uploaded":"2020-11-24T20:10:32.522Z","directDownload":"/cdn/11445/d3be6bc67cda1f13b3ac91c6b98d90605153f7f9.zip","downloadURL":"/api/download/key/11445","coverURL":"/cdn/11445/d3be6bc67cda1f13b3ac91c6b98d90605153f7f9.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":true,"expertPlus":false,"hard":true,"normal":true},"duration":96,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":269.302083,"length":89,"njs":8,"njsOffset":0,"bombs":0,"notes":179,"obstacles":18},"expert":{"duration":269.302083,"length":89,"njs":15,"njsOffset":0,"bombs":14,"notes":403,"obstacles":112},"expertPlus":null,"hard":{"duration":269.302083,"length":89,"njs":13,"njsOffset":0,"bombs":11,"notes":360,"obstacles":102},"normal":{"duration":269.302083,"length":89,"njs":10,"njsOffset":0,"bombs":20,"notes":286,"obstacles":30}},"name":"Standard"}],"levelAuthorName":"rodysan","songAuthorName":"Ryu*","songName":"Sakura Sunrise","songSubName":"","bpm":181},"stats":{"downloads":91,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2705277,"rating":0},"description":"9","deletedAt":null,"_id":"5fbde325ea68e70007b1fd1e","key":"1149b","name":"Sakura Sunrise - Ryu☆","uploader":{"_id":"5fabfd44fe23c6000688154a","username":"rodysan"},"hash":"eea9c9813c1a06ce2ea754a4d4557f98bdc33d33","uploaded":"2020-11-25T04:52:53.745Z","directDownload":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.zip","downloadURL":"/api/download/key/1149b","coverURL":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.png"}],"totalDocs":35532,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_hot().await.unwrap();
}
#[async_test]
async fn test_maps_rating() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/rating").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":true},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":417,"length":195,"bombs":4,"notes":301,"obstacles":24,"njs":10,"njsOffset":0},"hard":{"duration":417,"length":195,"bombs":4,"notes":486,"obstacles":24,"njs":10,"njsOffset":0},"expert":{"duration":417.5,"length":195,"bombs":4,"notes":620,"obstacles":24,"njs":10,"njsOffset":0},"expertPlus":{"duration":417.5,"length":195,"bombs":0,"notes":894,"obstacles":0,"njs":12,"njsOffset":0}}}],"songName":"Shut Up and Dance","songSubName":"WALK THE MOON","songAuthorName":"BennyDaBeast","levelAuthorName":"bennydabeast","bpm":128},"stats":{"downloads":422048,"plays":558,"downVotes":136,"upVotes":10824,"heat":395.8248964,"rating":0.9579470354714587},"description":"Difficulties: Expert+ (Added 11/15), Expert, Hard, Normal\r\nYouTube Preview: https://youtu.be/x9hJbTlPQUY","deletedAt":null,"_id":"5cff621148229f7d88fc77c9","key":"2144","name":"Shut Up and Dance - WALK THE MOON","uploader":{"_id":"5cff0b7298cc5a672c84e98d","username":"bennydabeast"},"uploaded":"2018-11-21T01:27:00.000Z","hash":"89cf8bb07afb3c59ae7b5ac00337d62261c36fb4","directDownload":"/cdn/2144/89cf8bb07afb3c59ae7b5ac00337d62261c36fb4.zip","downloadURL":"/api/download/key/2144","coverURL":"/cdn/2144/89cf8bb07afb3c59ae7b5ac00337d62261c36fb4.png"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":623.3125,"length":214,"bombs":0,"notes":462,"obstacles":25,"njs":10,"njsOffset":0},"hard":{"duration":623.3125,"length":214,"bombs":0,"notes":639,"obstacles":40,"njs":10,"njsOffset":0},"expert":{"duration":623.3125,"length":214,"bombs":0,"notes":825,"obstacles":40,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Mr. Blue Sky","songSubName":"Electric Light Orchestra","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":174},"stats":{"downloads":929036,"plays":39426,"downVotes":485,"upVotes":22691,"heat":94.0178926,"rating":0.9558250129688451},"description":"Channel your inner Baby Groot. Normal, Hard, Expert\r\nSpecial thanks to BennydaBeast for his help on this track!","deletedAt":null,"_id":"5cff620d48229f7d88fc65f7","key":"570","name":"Mr. Blue Sky | Electric Light Orchestra","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-06-16T16:53:34.000Z","hash":"236173d5ba7dc379d480b9cb5fb6b4fa5abe77da","directDownload":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.zip","downloadURL":"/api/download/key/570","coverURL":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":475,"length":226,"bombs":0,"notes":620,"obstacles":10,"njs":10,"njsOffset":0},"expert":{"duration":475,"length":226,"bombs":0,"notes":738,"obstacles":11,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Feel Invincible","songSubName":"Skillet","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":126},"stats":{"downloads":266051,"plays":3479,"downVotes":90,"upVotes":7150,"heat":231.7515825,"rating":0.9539859440299348},"description":"Expert / Hard\r\nhttps://www.youtube.com/watch?v=nq-Qul4XxbE","deletedAt":null,"_id":"5cff620f48229f7d88fc6eba","key":"121f","name":"Skillet - Feel Invincible","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-08-27T16:47:05.000Z","hash":"2e9ab6e1fb8055649e241cade98b018926cc93a8","directDownload":"/cdn/121f/2e9ab6e1fb8055649e241cade98b018926cc93a8.zip","downloadURL":"/api/download/key/121f","coverURL":"/cdn/121f/2e9ab6e1fb8055649e241cade98b018926cc93a8.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":476.7637634277344,"length":173,"bombs":52,"notes":722,"obstacles":28,"njs":14,"njsOffset":0},"expertPlus":null}}],"songName":"Caramelldansen (Speedcake Remix)","songSubName":"Caramell","songAuthorName":"Dack","levelAuthorName":"Dack","bpm":165},"stats":{"downloads":257793,"plays":0,"downVotes":249,"upVotes":13203,"heat":604.9856039,"rating":0.9539671938016036},"description":"Preview: https://youtu.be/V5p0HOzunY0\n\n\nPatreon: https://www.patreon.com/Dack","deletedAt":null,"_id":"5cff621548229f7d88fc8904","key":"3cf5","name":"Caramelldansen","uploader":{"_id":"5cff0b7598cc5a672c852c6f","username":"dack"},"uploaded":"2019-03-09T22:54:54.000Z","hash":"cf5e32d6b7f30095f7198da5894139c92336cad7","directDownload":"/cdn/3cf5/cf5e32d6b7f30095f7198da5894139c92336cad7.zip","downloadURL":"/api/download/key/3cf5","coverURL":"/cdn/3cf5/cf5e32d6b7f30095f7198da5894139c92336cad7.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":418,"length":200,"bombs":0,"notes":216,"obstacles":0,"njs":10,"njsOffset":0},"normal":{"duration":418,"length":200,"bombs":0,"notes":388,"obstacles":8,"njs":10,"njsOffset":0},"hard":{"duration":418,"length":200,"bombs":0,"notes":514,"obstacles":10,"njs":11,"njsOffset":0},"expert":{"duration":418,"length":200,"bombs":0,"notes":560,"obstacles":12,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Believer (100k ver.)","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":514839,"plays":9381,"downVotes":217,"upVotes":11958,"heat":379.9016606,"rating":0.953774738159888},"description":"This is one of the 22 maps that were mapped for the 100k Contest where you can win over $7,000 in prizes. Go to https://bsaber.com/100k-contest/ to register!","deletedAt":null,"_id":"5cff621148229f7d88fc76ec","key":"1fef","name":"Imagine Dragons - Believer (100k ver.) | 100k Contest","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-11-12T17:53:58.000Z","hash":"9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390","directDownload":"/cdn/1fef/9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390.zip","downloadURL":"/api/download/key/1fef","coverURL":"/cdn/1fef/9a7a5beadfdd1c7c0f137ecba6e5f6ff377eb390.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":501.19000244140625,"length":227,"bombs":0,"notes":671,"obstacles":16,"njs":10,"njsOffset":0},"expert":{"duration":501.19000244140625,"length":227,"bombs":0,"notes":831,"obstacles":16,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Daddy","songSubName":"PSY","songAuthorName":"Fafurion","levelAuthorName":"fafurion","bpm":132},"stats":{"downloads":251102,"plays":2330,"downVotes":123,"upVotes":8386,"heat":243.8954711,"rating":0.953687887575571},"description":"Insanely fun dance map! Enjoy!\r\nSee the map in action (Expert): https://www.youtube.com/watch?v=cWz6flYGs20\r\n\r\nThank you to my playtesters:\r\nQTPop (https://www.twitch.tv/qtpop)\r\nDuoVR (https://www.twitch.tv/duovr)\r\nSourgurl (https://www.twitch.tv/sourgurl)\r\nRexxxzi (https://www.twitch.tv/rexxxzi)\r\nAshleyriott (https://www.twitch.tv/ashleyriott)\r\n\r\nDiscord: @Fufu#5452","deletedAt":null,"_id":"5cff620f48229f7d88fc6f6c","key":"133b","name":"Daddy - PSY","uploader":{"_id":"5cff0b7398cc5a672c84f945","username":"fafurion"},"uploaded":"2018-09-02T23:43:45.000Z","hash":"dc489921185f92dfecb9cb07b84fc556123bd134","directDownload":"/cdn/133b/dc489921185f92dfecb9cb07b84fc556123bd134.zip","downloadURL":"/api/download/key/133b","coverURL":"/cdn/133b/dc489921185f92dfecb9cb07b84fc556123bd134.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":523.625,"length":245,"bombs":0,"notes":633,"obstacles":13,"njs":10,"njsOffset":0},"expert":{"duration":523.5650024414062,"length":245,"bombs":0,"notes":880,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Uprising","songSubName":"Muse","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":128},"stats":{"downloads":458225,"plays":11598,"downVotes":163,"upVotes":9224,"heat":84.4207539,"rating":0.9518918933740727},"description":"Expert / Hard\r\nhttps://youtu.be/WpFUt3UNp7c","deletedAt":null,"_id":"5cff620d48229f7d88fc655e","key":"4c6","name":"Muse - Uprising","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-06-11T21:47:41.000Z","hash":"00e5671e594a6fe621c3605fcc5a0e4466ba6478","directDownload":"/cdn/4c6/00e5671e594a6fe621c3605fcc5a0e4466ba6478.zip","downloadURL":"/api/download/key/4c6","coverURL":"/cdn/4c6/00e5671e594a6fe621c3605fcc5a0e4466ba6478.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":true,"hard":false,"normal":false},"duration":0,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":547,"length":234,"njs":12,"njsOffset":0,"bombs":0,"notes":705,"obstacles":10},"expertPlus":{"duration":547,"length":234,"njs":16,"njsOffset":0,"bombs":0,"notes":876,"obstacles":10},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"KikaeAeon","songAuthorName":"League of Legends & Against The Current","songName":"Legends Never Die","songSubName":"","bpm":140},"stats":{"downloads":142656,"plays":0,"downVotes":87,"upVotes":6241,"heat":997.2555043,"rating":0.9513740970623574},"description":"A special request from Prima1URGE","deletedAt":null,"_id":"5d91d6c1871b1a0006f9b3e7","key":"66e6","name":"League of Legends - Legends never die (ft. Against The Current)","uploader":{"_id":"5cff0b7498cc5a672c85109b","username":"kikaeaeon"},"hash":"732bd4072b89d4b3bf0e63db812a7ffc3096e837","uploaded":"2019-09-30T10:19:45.606Z","directDownload":"/cdn/66e6/732bd4072b89d4b3bf0e63db812a7ffc3096e837.zip","downloadURL":"/api/download/key/66e6","coverURL":"/cdn/66e6/732bd4072b89d4b3bf0e63db812a7ffc3096e837.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":578,"length":194,"bombs":8,"notes":519,"obstacles":86,"njs":13,"njsOffset":0},"expert":{"duration":578,"length":194,"bombs":10,"notes":679,"obstacles":86,"njs":16,"njsOffset":0},"expertPlus":null}}],"songName":"Flamingo","songSubName":"Kero Kero Bonito","songAuthorName":"ETAN","levelAuthorName":"ETAN","bpm":178},"stats":{"downloads":142323,"plays":0,"downVotes":90,"upVotes":6344,"heat":744.9785357,"rating":0.9513253928566593},"description":"edited: NJS was a tad slow my b\r\nfuramingo \r\noh oh ooh oh\r\nthis needed to be remapped\r\n \r\nPlease check out Kero Kero Bonito and the rest of their songs\r\nI'll be mappin more of em soon\r\n\r\nBPM 178\r\nFlamingo (Expert)\r\nShrimp (Hard)\r\n\r\nhave fun \r\n\r\ngimme feedback on Discord\r\nETAN#8341","deletedAt":null,"_id":"5cff621748229f7d88fc93fc","key":"4e6f","name":"Kero Kero Bonito - Flamingo","uploader":{"_id":"5cff0b7798cc5a672c855775","username":"etan"},"uploaded":"2019-05-22T00:46:47.000Z","hash":"585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b","directDownload":"/cdn/4e6f/585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b.zip","downloadURL":"/api/download/key/4e6f","coverURL":"/cdn/4e6f/585ee25e654ebf5db5aa0ec02c3bcecbaccf3e0b.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":689.8004760742188,"length":242,"bombs":16,"notes":1093,"obstacles":16,"njs":14,"njsOffset":0},"expertPlus":null}}],"songName":"IGNITE","songSubName":"Aoi Eir","songAuthorName":"Joetastic","levelAuthorName":"Joetastic","bpm":171},"stats":{"downloads":266468,"plays":0,"downVotes":141,"upVotes":7933,"heat":451.3606934,"rating":0.9503730517090982},"description":"Trying to get this version ranked! New version with changes according to the ranking criteria: Double directional notes fixed, flow improvements, removed fast dodge walls on bridge section.","deletedAt":null,"_id":"5cff621248229f7d88fc7b21","key":"26f6","name":"IGNITE (Ranked Version) [Sword Art Online Season 2 Opening] - Aoi Eir","uploader":{"_id":"5cff0b7498cc5a672c85050e","username":"joetastic"},"uploaded":"2018-12-20T01:21:47.000Z","hash":"125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c","directDownload":"/cdn/26f6/125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c.zip","downloadURL":"/api/download/key/26f6","coverURL":"/cdn/26f6/125b07ebcc06fe9667e83fc2d6b9ae5ecbc72e8c.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_rating().await.unwrap();
}
#[async_test]
async fn test_maps_latest() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/latest").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":225,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":512,"length":219,"njs":20,"njsOffset":-0.550000011920929,"bombs":101,"notes":688,"obstacles":35},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"AuroraModz","songAuthorName":"Cafe Disko","songName":"So High","songSubName":"(feat. Danél)","bpm":140},"stats":{"downloads":0,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.4047171,"rating":0},"description":"Mapped By UwUCrew.\nWe are a various mapping team that makes songs based on what the community wants. If you would like to request a song join this discord>https://discord.gg/YueyEWb\n","deletedAt":null,"_id":"5fbdfabcea68e70007b216f6","key":"1149f","name":"Cafe Disko - So High (feat. Danél)","uploader":{"_id":"5f292e68c9b14c0006ce923f","username":"uwucrew"},"hash":"56941d85c66142fb91aaa62eeb36e65262343d9a","uploaded":"2020-11-25T06:33:32.268Z","directDownload":"/cdn/1149f/56941d85c66142fb91aaa62eeb36e65262343d9a.zip","downloadURL":"/api/download/key/1149f","coverURL":"/cdn/1149f/56941d85c66142fb91aaa62eeb36e65262343d9a.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":110,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":174.537,"length":58,"njs":23,"njsOffset":-0.5,"bombs":6,"notes":333,"obstacles":46},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Astrella","songAuthorName":"Breakmaster Cylinder","songName":"The Most Gangster Drop","songSubName":"","bpm":180},"stats":{"downloads":21,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3840344,"rating":0},"description":"gangster awehfiuawefluiawehfaiuwhfewaf","deletedAt":null,"_id":"5fbdf719ea68e70007b21333","key":"1149e","name":"The Most Gangster Drop - Breakmaster Cylinder","uploader":{"_id":"5fa1e74381e1d70006f2cc01","username":"c0r3nn"},"hash":"d6a267ea3d6a0d715d1d320e7773ad646aa2a424","uploaded":"2020-11-25T06:18:01.546Z","directDownload":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.zip","downloadURL":"/api/download/key/1149e","coverURL":"/cdn/1149e/d6a267ea3d6a0d715d1d320e7773ad646aa2a424.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":true,"expertPlus":false,"hard":false,"normal":false},"duration":239,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":{"duration":243.375,"length":101,"njs":12,"njsOffset":0,"bombs":0,"notes":300,"obstacles":2},"expertPlus":null,"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"Packz","songAuthorName":"Illenium, John Bellion","songName":"Good Things Fall Apart - Illenium, John Bellion","songSubName":"","bpm":144},"stats":{"downloads":77,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.3043823,"rating":0},"description":"this is a test map dont download","deletedAt":null,"_id":"5fbde91900e48a00065ae757","key":"1149d","name":"tyui","uploader":{"_id":"5f9a3ba76ef6a20006d59aea","username":"milla"},"hash":"eb7f40e59ee44be638054b3ca41f4f4b7b5b357f","uploaded":"2020-11-25T05:18:17.204Z","directDownload":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.zip","downloadURL":"/api/download/key/1149d","coverURL":"/cdn/1149d/eb7f40e59ee44be638054b3ca41f4f4b7b5b357f.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":74,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":399,"length":106,"njs":23,"njsOffset":-0.20000000298023224,"bombs":0,"notes":931,"obstacles":0},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"DE125","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix) (Literally Just the First Drop Ver.)","bpm":225},"stats":{"downloads":91,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2910497,"rating":0},"description":"Literally just the first drop.\nI overmapped this so the pattern would work B)\n\nDm with issues @DE125#0001 if the issue isn't cringe saut burnt rice pattern","deletedAt":null,"_id":"5fbde6c1ea68e70007b20165","key":"1149c","name":"you - Melancholia (EKU's Desolation Remix) (TV Size)","uploader":{"_id":"5cff0b7798cc5a672c8554ba","username":"de125"},"hash":"2cb3a27602b362a6265fdfd543f4eec31f957ba4","uploaded":"2020-11-25T05:08:17.236Z","directDownload":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.zip","downloadURL":"/api/download/key/1149c","coverURL":"/cdn/1149c/2cb3a27602b362a6265fdfd543f4eec31f957ba4.jpg"},{"metadata":{"difficulties":{"easy":true,"expert":true,"expertPlus":false,"hard":true,"normal":true},"duration":96,"automapper":null,"characteristics":[{"difficulties":{"easy":{"duration":269.302083,"length":89,"njs":8,"njsOffset":0,"bombs":0,"notes":179,"obstacles":18},"expert":{"duration":269.302083,"length":89,"njs":15,"njsOffset":0,"bombs":14,"notes":403,"obstacles":112},"expertPlus":null,"hard":{"duration":269.302083,"length":89,"njs":13,"njsOffset":0,"bombs":11,"notes":360,"obstacles":102},"normal":{"duration":269.302083,"length":89,"njs":10,"njsOffset":0,"bombs":20,"notes":286,"obstacles":30}},"name":"Standard"}],"levelAuthorName":"rodysan","songAuthorName":"Ryu*","songName":"Sakura Sunrise","songSubName":"","bpm":181},"stats":{"downloads":96,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.2705277,"rating":0},"description":"9","deletedAt":null,"_id":"5fbde325ea68e70007b1fd1e","key":"1149b","name":"Sakura Sunrise - Ryu☆","uploader":{"_id":"5fabfd44fe23c6000688154a","username":"rodysan"},"hash":"eea9c9813c1a06ce2ea754a4d4557f98bdc33d33","uploaded":"2020-11-25T04:52:53.745Z","directDownload":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.zip","downloadURL":"/api/download/key/1149b","coverURL":"/cdn/1149b/eea9c9813c1a06ce2ea754a4d4557f98bdc33d33.png"},{"metadata":{"difficulties":{"easy":true,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":240,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":525.5,"length":233,"njs":12,"njsOffset":0,"bombs":235,"notes":1036,"obstacles":46},"hard":null,"normal":null},"name":"Standard"},{"difficulties":{"easy":{"duration":0,"length":0,"njs":16,"njsOffset":0,"bombs":0,"notes":0,"obstacles":0},"expert":null,"expertPlus":null,"hard":null,"normal":null},"name":"Lightshow"}],"levelAuthorName":"jd gamer65","songAuthorName":"CG5, Pokimane, TheRandomMusicMan, ect","songName":"A Killer on the floor","songSubName":"Among Us Rap Battle","bpm":135},"stats":{"downloads":116,"plays":0,"downVotes":1,"upVotes":1,"heat":1803.2316104,"rating":0.5},"description":"Made with the help of beatsage.com It is a bit choppy at bits, because i am a amateur editor. Hope you enjoy my first song I fully mapped! BTW there is a light show mode in case you wanna watch my dynamic lighting.","deletedAt":null,"_id":"5fbddc4ee3a5a20006f9bfb0","key":"11493","name":"Killer on the Floor, Among Us Rap Battle ","uploader":{"_id":"5f03f3fb8f03870006ab590f","username":"jd gamer65"},"hash":"6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26","uploaded":"2020-11-25T04:23:42.467Z","directDownload":"/cdn/11493/6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26.zip","downloadURL":"/api/download/key/11493","coverURL":"/cdn/11493/6eb3bf646cb3f8e8ec3f39bc581091b3ba34ce26.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":49,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":203.5,"length":46,"njs":26,"njsOffset":-0.05000000074505806,"bombs":121,"notes":506,"obstacles":5},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"MonsterWook regrets this","songAuthorName":"Nickelodeon","songName":"FanBoy & ChumChum Theme Song","songSubName":"","bpm":260.0740051269531},"stats":{"downloads":112,"plays":0,"downVotes":0,"upVotes":1,"heat":1803.2228074,"rating":0.5941636475090435},"description":"BA BAB ABA ABA BA AB ABA BA BA ABB A ABA A BA BAB ABABAB ABB BRAIN FREEEZEEEEEE BABA BBBABABABBABABAB","deletedAt":null,"_id":"5fbddac2ea68e70007b1f529","key":"11492","name":"yes hahaha - FanBoy & ChumChum Theme Song","uploader":{"_id":"5e3e058b470a82000675dc55","username":"monsterwook2"},"hash":"b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb","uploaded":"2020-11-25T04:17:06.334Z","directDownload":"/cdn/11492/b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb.zip","downloadURL":"/api/download/key/11492","coverURL":"/cdn/11492/b011d57f737a6a0ff2700ee2dfa7af37b4fdb8bb.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":false,"hard":true,"normal":true},"duration":235,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":null,"hard":{"duration":388,"length":232,"njs":14,"njsOffset":0,"bombs":0,"notes":874,"obstacles":9},"normal":{"duration":381.25,"length":228,"njs":12,"njsOffset":0,"bombs":60,"notes":374,"obstacles":52}},"name":"Standard"}],"levelAuthorName":"Alekcake","songAuthorName":"Amerie","songName":"1 Thing","songSubName":"","bpm":100},"stats":{"downloads":103,"plays":0,"downVotes":0,"upVotes":1,"heat":1803.2192485,"rating":0.5941636475090435},"description":"Special request :D\r\n\r\nGet in touch with us on our discord server!\r\nAlekcake's Kpop & VR Arcade - https://discord.gg/P4eGh26","deletedAt":null,"_id":"5fbdda22910759000612f575","key":"11490","name":"Amerie - 1 Thing","uploader":{"_id":"5ee6cc499ae7380006da7aef","username":"alekcake"},"hash":"5e4f00d81ef0363439c712c64f35dfea017918f9","uploaded":"2020-11-25T04:14:26.181Z","directDownload":"/cdn/11490/5e4f00d81ef0363439c712c64f35dfea017918f9.zip","downloadURL":"/api/download/key/11490","coverURL":"/cdn/11490/5e4f00d81ef0363439c712c64f35dfea017918f9.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":191,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":316,"length":184,"njs":18,"njsOffset":1,"bombs":0,"notes":935,"obstacles":94},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"MisterZ did it","songAuthorName":"LINKIN PARK","songName":"Pushing Me Away","songSubName":"","bpm":103},"stats":{"downloads":112,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.203822,"rating":0},"description":"","deletedAt":null,"_id":"5fbdd76b5fd85f00069233d5","key":"1148e","name":"Pushing Me Away","uploader":{"_id":"5f52d68f9824150006c5a23b","username":"misterz did it"},"hash":"fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2","uploaded":"2020-11-25T04:02:51.989Z","directDownload":"/cdn/1148e/fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2.zip","downloadURL":"/api/download/key/1148e","coverURL":"/cdn/1148e/fa9ca90cf19f8316e0fcbf606a5c20a313f2a5d2.jpg"},{"metadata":{"difficulties":{"easy":false,"expert":false,"expertPlus":true,"hard":false,"normal":false},"duration":350,"automapper":null,"characteristics":[{"difficulties":{"easy":null,"expert":null,"expertPlus":{"duration":1264.1478271484375,"length":337,"njs":22,"njsOffset":-0.28999999165534973,"bombs":9,"notes":2553,"obstacles":250},"hard":null,"normal":null},"name":"Standard"}],"levelAuthorName":"abcbadq","songAuthorName":"you","songName":"Melancholia","songSubName":"(EKU's Desolation Remix)","bpm":225},"stats":{"downloads":122,"plays":0,"downVotes":0,"upVotes":0,"heat":1803.1947261,"rating":0},"description":"crow walls thats all you need to know\nrequested by saints","deletedAt":null,"_id":"5fbdd5d239a7430006a0485d","key":"1148c","name":"Melancholia (EKU's Desolation Remix)","uploader":{"_id":"5e0344ebe85d6800061edc97","username":"abcbadq"},"hash":"94e516fab1650261b372ee83f51a9fe5fa6b2908","uploaded":"2020-11-25T03:56:02.673Z","directDownload":"/cdn/1148c/94e516fab1650261b372ee83f51a9fe5fa6b2908.zip","downloadURL":"/api/download/key/1148c","coverURL":"/cdn/1148c/94e516fab1650261b372ee83f51a9fe5fa6b2908.png"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_latest().await.unwrap();
}
#[async_test]
async fn test_maps_downloads() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/downloads").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":468,"length":212,"bombs":4,"notes":415,"obstacles":42,"njs":10,"njsOffset":0},"hard":{"duration":468,"length":212,"bombs":40,"notes":695,"obstacles":94,"njs":10,"njsOffset":0},"expert":{"duration":468,"length":212,"bombs":50,"notes":932,"obstacles":103,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Gangnam Style","songSubName":"PSY","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":132},"stats":{"downloads":1069206,"plays":82700,"downVotes":617,"upVotes":17445,"heat":41.5047436,"rating":0.94147214608232},"description":"Expert, Hard, and Normal tracks. I tried my best to setup the chorus charts to allow you to mimic the classic dance moves. I think it matches up quite nicely. I hope you have as much fun playing as I did making this! Enjoy!","deletedAt":null,"_id":"5cff620c48229f7d88fc620d","key":"141","name":"GANGNAM STYLE","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-05-20T09:59:02.000Z","hash":"8e7e553099436af31564adf1977a5ec42a61cfff","directDownload":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.zip","downloadURL":"/api/download/key/141","coverURL":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":418,"length":200,"bombs":0,"notes":546,"obstacles":10,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Believer","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":1045930,"plays":70725,"downVotes":352,"upVotes":9390,"heat":18.911539,"rating":0.9346479331024395},"description":"Currently expert only. Events included.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e9","key":"b","name":"Imagine Dragons - Believer","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-05-08T18:56:36.000Z","hash":"19f2879d11a91b51a5c090d63471c3e8d9b7aee3","directDownload":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.zip","downloadURL":"/api/download/key/b","coverURL":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":328.556396484375,"length":142,"bombs":0,"notes":188,"obstacles":84,"njs":10,"njsOffset":0},"normal":{"duration":328.681396484375,"length":142,"bombs":40,"notes":219,"obstacles":70,"njs":10,"njsOffset":0},"hard":{"duration":328.681396484375,"length":142,"bombs":42,"notes":386,"obstacles":72,"njs":10,"njsOffset":0},"expert":{"duration":328.681396484375,"length":142,"bombs":46,"notes":623,"obstacles":69,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Beat it","songSubName":"Michael Jackson","songAuthorName":"Freeek","levelAuthorName":"freeek","bpm":139},"stats":{"downloads":941091,"plays":117624,"downVotes":768,"upVotes":12584,"heat":51.2995594,"rating":0.9171309232285056},"description":"Easy/Normal/Hard/Expert - Obstacles and mines purely for dance moves! 100% Expert Playthrough: https://bit.ly/2IKzCp3\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62d6","key":"217","name":"Beat it - Michael Jackson","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T14:20:19.000Z","hash":"4b2da842b687ec4cfbc948c583c21c79d4120de0","directDownload":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.zip","downloadURL":"/api/download/key/217","coverURL":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":640.7428588867188,"length":311,"bombs":57,"notes":423,"obstacles":33,"njs":10,"njsOffset":0},"expert":{"duration":640.7428588867188,"length":311,"bombs":68,"notes":616,"obstacles":33,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Harder Better Faster Stronger","songSubName":"Daft Punk","songAuthorName":"RunRockGame","levelAuthorName":"runrockgame","bpm":123},"stats":{"downloads":939245,"plays":74223,"downVotes":761,"upVotes":13105,"heat":65.0537892,"rating":0.9199051796117618},"description":"Expert & Hard | 600+ Blocks | Full Song 3:44 | Includes Lighting. Request to: @themakertales","deletedAt":null,"_id":"5cff620c48229f7d88fc63dd","key":"32e","name":"Daft Punk - Harder Better Faster Stronger","uploader":{"_id":"5cff0b7398cc5a672c84f04e","username":"runrockgame"},"uploaded":"2018-06-01T18:01:45.000Z","hash":"7c7f38d467bb43fe11a142581e63e324622ecc71","directDownload":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.zip","downloadURL":"/api/download/key/32e","coverURL":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":623.3125,"length":214,"bombs":0,"notes":462,"obstacles":25,"njs":10,"njsOffset":0},"hard":{"duration":623.3125,"length":214,"bombs":0,"notes":639,"obstacles":40,"njs":10,"njsOffset":0},"expert":{"duration":623.3125,"length":214,"bombs":0,"notes":825,"obstacles":40,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Mr. Blue Sky","songSubName":"Electric Light Orchestra","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":174},"stats":{"downloads":929040,"plays":39426,"downVotes":485,"upVotes":22691,"heat":94.0178926,"rating":0.9558250129688451},"description":"Channel your inner Baby Groot. Normal, Hard, Expert\r\nSpecial thanks to BennydaBeast for his help on this track!","deletedAt":null,"_id":"5cff620d48229f7d88fc65f7","key":"570","name":"Mr. Blue Sky | Electric Light Orchestra","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-06-16T16:53:34.000Z","hash":"236173d5ba7dc379d480b9cb5fb6b4fa5abe77da","directDownload":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.zip","downloadURL":"/api/download/key/570","coverURL":"/cdn/570/236173d5ba7dc379d480b9cb5fb6b4fa5abe77da.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":590.65625,"length":232,"bombs":0,"notes":768,"obstacles":154,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Rasputin (Funk Overload)","songSubName":"","songAuthorName":"Jobas","levelAuthorName":"jobas","bpm":149},"stats":{"downloads":796456,"plays":29624,"downVotes":774,"upVotes":17434,"heat":40.1104306,"rating":0.9336181107580133},"description":"Hard\r\nBpm 147\r\nspeed up version of rasputin Original","deletedAt":null,"_id":"5cff620c48229f7d88fc61f0","key":"124","name":"Rasputin (Funk Overload)","uploader":{"_id":"5cff0b7298cc5a672c84e9a2","username":"jobas"},"uploaded":"2018-05-19T16:36:34.000Z","hash":"9a1d001995cc0a2014352aa7148cbcbf2e489d89","directDownload":"/cdn/124/9a1d001995cc0a2014352aa7148cbcbf2e489d89.zip","downloadURL":"/api/download/key/124","coverURL":"/cdn/124/9a1d001995cc0a2014352aa7148cbcbf2e489d89.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":473.1875,"length":228,"bombs":0,"notes":399,"obstacles":0,"njs":10,"njsOffset":0},"hard":{"duration":473.1875,"length":228,"bombs":0,"notes":496,"obstacles":0,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Seven Nation Army","songSubName":"The White Stripes","songAuthorName":"BlueASIS","levelAuthorName":"blueasis","bpm":124},"stats":{"downloads":776038,"plays":56470,"downVotes":437,"upVotes":11620,"heat":74.676625,"rating":0.93635850868144},"description":"UPDATED! @BlueASIS#4095 on Discord let me know what you think","deletedAt":null,"_id":"5cff620d48229f7d88fc64a0","key":"3fc","name":"The White Stripes - Seven Nation Army","uploader":{"_id":"5cff0b7298cc5a672c84eb5d","username":"blueasis"},"uploaded":"2018-06-06T18:51:03.000Z","hash":"0b0ad0f34b2d0687a9794bcf5019100fda06971e","directDownload":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.zip","downloadURL":"/api/download/key/3fc","coverURL":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":384,"length":136,"bombs":0,"notes":505,"obstacles":52,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Take On Me","songSubName":"","songAuthorName":"a-ha","levelAuthorName":"jackscape","bpm":168},"stats":{"downloads":770057,"plays":36801,"downVotes":549,"upVotes":5946,"heat":18.5911969,"rating":0.8859054068140281},"description":"Expert only","deletedAt":null,"_id":"5cff620c48229f7d88fc60e7","key":"9","name":"a-ha - Take On Me","uploader":{"_id":"5cff0b7298cc5a672c84e8bb","username":"jackscape"},"uploaded":"2018-05-08T17:44:17.000Z","hash":"2aa1f5192828e075c30dd015b1e132bba912eb86","directDownload":"/cdn/9/2aa1f5192828e075c30dd015b1e132bba912eb86.zip","downloadURL":"/api/download/key/9","coverURL":"/cdn/9/2aa1f5192828e075c30dd015b1e132bba912eb86.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":342.8125,"length":165,"bombs":0,"notes":313,"obstacles":27,"njs":10,"njsOffset":0},"normal":{"duration":343.8125,"length":166,"bombs":0,"notes":480,"obstacles":27,"njs":10,"njsOffset":0},"hard":{"duration":343.8125,"length":166,"bombs":0,"notes":730,"obstacles":27,"njs":10,"njsOffset":0},"expert":{"duration":341.75,"length":165,"bombs":11,"notes":735,"obstacles":2,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Lone Digger","songSubName":"","songAuthorName":"Caravan Palace","levelAuthorName":"calijor","bpm":124},"stats":{"downloads":677450,"plays":57999,"downVotes":823,"upVotes":14212,"heat":46.3871704,"rating":0.920647601959446},"description":"Caravan Palace - Lone Digger\r\nEasy | Normal | Hard | Expert\r\nThis is a re-upload of my previous map, with improvements for hard, and a new, harder expert difficulty mapped by Squeaksies, as well as lower difficulties as iterations on my original map.\r\n\r\nBPM: 124\r\nDuration: 2:49\r\nNotes (Hard): 730\r\nNotes (Expert): 735\r\nPreview (Hard): https://youtu.be/NExvLUyeBUU\r\nPreview (Expert): https://youtu.be/NYmExXlpB0k","deletedAt":null,"_id":"5cff620c48229f7d88fc6282","key":"1bf","name":"Caravan Palace - Lone Digger","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-23T00:15:19.000Z","hash":"906160fd1f808e2f34f33c2ca5920118855c065d","directDownload":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.zip","downloadURL":"/api/download/key/1bf","coverURL":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":382.4375,"length":246,"bombs":0,"notes":728,"obstacles":16,"njs":10,"njsOffset":0},"hard":{"duration":387.4375,"length":249,"bombs":0,"notes":836,"obstacles":19,"njs":10,"njsOffset":0},"expert":{"duration":387.4375,"length":249,"bombs":0,"notes":883,"obstacles":31,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Africa","songSubName":"","songAuthorName":"Toto","levelAuthorName":"calijor","bpm":92},"stats":{"downloads":669322,"plays":27043,"downVotes":1106,"upVotes":5060,"heat":40.3054811,"rating":0.7974511907115919},"description":"Bless the rains!\r\n\r\nExpert, hard, and normal difficulty available. I do apologize, but I think they're a bit harder than vanilla.\r\n\r\nBPM: 92\r\nNotes: 883 (expert)\r\nDuration: 4:20\r\n\r\nPreview: https://youtu.be/SLpUwKson80","deletedAt":null,"_id":"5cff620c48229f7d88fc6203","key":"137","name":"Toto - Africa","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-20T02:51:20.000Z","hash":"12fee98db7d2080724435d0a1442545f21a9134d","directDownload":"/cdn/137/12fee98db7d2080724435d0a1442545f21a9134d.zip","downloadURL":"/api/download/key/137","coverURL":"/cdn/137/12fee98db7d2080724435d0a1442545f21a9134d.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_downloads().await.unwrap();
}
#[async_test]
async fn test_maps_plays() {
let client = FakeClient::new(BEATSAVER_URL.join("api/maps/plays").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":328.556396484375,"length":142,"bombs":0,"notes":188,"obstacles":84,"njs":10,"njsOffset":0},"normal":{"duration":328.681396484375,"length":142,"bombs":40,"notes":219,"obstacles":70,"njs":10,"njsOffset":0},"hard":{"duration":328.681396484375,"length":142,"bombs":42,"notes":386,"obstacles":72,"njs":10,"njsOffset":0},"expert":{"duration":328.681396484375,"length":142,"bombs":46,"notes":623,"obstacles":69,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Beat it","songSubName":"Michael Jackson","songAuthorName":"Freeek","levelAuthorName":"freeek","bpm":139},"stats":{"downloads":941091,"plays":117624,"downVotes":768,"upVotes":12584,"heat":51.2995594,"rating":0.9171309232285056},"description":"Easy/Normal/Hard/Expert - Obstacles and mines purely for dance moves! 100% Expert Playthrough: https://bit.ly/2IKzCp3\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62d6","key":"217","name":"Beat it - Michael Jackson","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T14:20:19.000Z","hash":"4b2da842b687ec4cfbc948c583c21c79d4120de0","directDownload":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.zip","downloadURL":"/api/download/key/217","coverURL":"/cdn/217/4b2da842b687ec4cfbc948c583c21c79d4120de0.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":468,"length":212,"bombs":4,"notes":415,"obstacles":42,"njs":10,"njsOffset":0},"hard":{"duration":468,"length":212,"bombs":40,"notes":695,"obstacles":94,"njs":10,"njsOffset":0},"expert":{"duration":468,"length":212,"bombs":50,"notes":932,"obstacles":103,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Gangnam Style","songSubName":"PSY","songAuthorName":"GreatYazer","levelAuthorName":"greatyazer","bpm":132},"stats":{"downloads":1069207,"plays":82700,"downVotes":617,"upVotes":17445,"heat":41.5047436,"rating":0.94147214608232},"description":"Expert, Hard, and Normal tracks. I tried my best to setup the chorus charts to allow you to mimic the classic dance moves. I think it matches up quite nicely. I hope you have as much fun playing as I did making this! Enjoy!","deletedAt":null,"_id":"5cff620c48229f7d88fc620d","key":"141","name":"GANGNAM STYLE","uploader":{"_id":"5cff0b7298cc5a672c84ea71","username":"greatyazer"},"uploaded":"2018-05-20T09:59:02.000Z","hash":"8e7e553099436af31564adf1977a5ec42a61cfff","directDownload":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.zip","downloadURL":"/api/download/key/141","coverURL":"/cdn/141/8e7e553099436af31564adf1977a5ec42a61cfff.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":640.7428588867188,"length":311,"bombs":57,"notes":423,"obstacles":33,"njs":10,"njsOffset":0},"expert":{"duration":640.7428588867188,"length":311,"bombs":68,"notes":616,"obstacles":33,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Harder Better Faster Stronger","songSubName":"Daft Punk","songAuthorName":"RunRockGame","levelAuthorName":"runrockgame","bpm":123},"stats":{"downloads":939245,"plays":74223,"downVotes":761,"upVotes":13105,"heat":65.0537892,"rating":0.9199051796117618},"description":"Expert & Hard | 600+ Blocks | Full Song 3:44 | Includes Lighting. Request to: @themakertales","deletedAt":null,"_id":"5cff620c48229f7d88fc63dd","key":"32e","name":"Daft Punk - Harder Better Faster Stronger","uploader":{"_id":"5cff0b7398cc5a672c84f04e","username":"runrockgame"},"uploaded":"2018-06-01T18:01:45.000Z","hash":"7c7f38d467bb43fe11a142581e63e324622ecc71","directDownload":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.zip","downloadURL":"/api/download/key/32e","coverURL":"/cdn/32e/7c7f38d467bb43fe11a142581e63e324622ecc71.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":418,"length":200,"bombs":0,"notes":546,"obstacles":10,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Believer","songSubName":"Imagine Dragons","songAuthorName":"Rustic","levelAuthorName":"rustic","bpm":125},"stats":{"downloads":1045930,"plays":70725,"downVotes":352,"upVotes":9390,"heat":18.911539,"rating":0.9346479331024395},"description":"Currently expert only. Events included.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e9","key":"b","name":"Imagine Dragons - Believer","uploader":{"_id":"5cff0b7298cc5a672c84e8c4","username":"rustic"},"uploaded":"2018-05-08T18:56:36.000Z","hash":"19f2879d11a91b51a5c090d63471c3e8d9b7aee3","directDownload":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.zip","downloadURL":"/api/download/key/b","coverURL":"/cdn/b/19f2879d11a91b51a5c090d63471c3e8d9b7aee3.jpg"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":342.8125,"length":165,"bombs":0,"notes":313,"obstacles":27,"njs":10,"njsOffset":0},"normal":{"duration":343.8125,"length":166,"bombs":0,"notes":480,"obstacles":27,"njs":10,"njsOffset":0},"hard":{"duration":343.8125,"length":166,"bombs":0,"notes":730,"obstacles":27,"njs":10,"njsOffset":0},"expert":{"duration":341.75,"length":165,"bombs":11,"notes":735,"obstacles":2,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Lone Digger","songSubName":"","songAuthorName":"Caravan Palace","levelAuthorName":"calijor","bpm":124},"stats":{"downloads":677451,"plays":57999,"downVotes":823,"upVotes":14212,"heat":46.3871704,"rating":0.920647601959446},"description":"Caravan Palace - Lone Digger\r\nEasy | Normal | Hard | Expert\r\nThis is a re-upload of my previous map, with improvements for hard, and a new, harder expert difficulty mapped by Squeaksies, as well as lower difficulties as iterations on my original map.\r\n\r\nBPM: 124\r\nDuration: 2:49\r\nNotes (Hard): 730\r\nNotes (Expert): 735\r\nPreview (Hard): https://youtu.be/NExvLUyeBUU\r\nPreview (Expert): https://youtu.be/NYmExXlpB0k","deletedAt":null,"_id":"5cff620c48229f7d88fc6282","key":"1bf","name":"Caravan Palace - Lone Digger","uploader":{"_id":"5cff0b7298cc5a672c84ebb1","username":"calijor"},"uploaded":"2018-05-23T00:15:19.000Z","hash":"906160fd1f808e2f34f33c2ca5920118855c065d","directDownload":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.zip","downloadURL":"/api/download/key/1bf","coverURL":"/cdn/1bf/906160fd1f808e2f34f33c2ca5920118855c065d.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":473.1875,"length":228,"bombs":0,"notes":399,"obstacles":0,"njs":10,"njsOffset":0},"hard":{"duration":473.1875,"length":228,"bombs":0,"notes":496,"obstacles":0,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"Seven Nation Army","songSubName":"The White Stripes","songAuthorName":"BlueASIS","levelAuthorName":"blueasis","bpm":124},"stats":{"downloads":776038,"plays":56470,"downVotes":437,"upVotes":11620,"heat":74.676625,"rating":0.93635850868144},"description":"UPDATED! @BlueASIS#4095 on Discord let me know what you think","deletedAt":null,"_id":"5cff620d48229f7d88fc64a0","key":"3fc","name":"The White Stripes - Seven Nation Army","uploader":{"_id":"5cff0b7298cc5a672c84eb5d","username":"blueasis"},"uploaded":"2018-06-06T18:51:03.000Z","hash":"0b0ad0f34b2d0687a9794bcf5019100fda06971e","directDownload":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.zip","downloadURL":"/api/download/key/3fc","coverURL":"/cdn/3fc/0b0ad0f34b2d0687a9794bcf5019100fda06971e.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":183.5,"length":81,"bombs":0,"notes":174,"obstacles":0,"njs":10,"njsOffset":0},"expert":{"duration":183.5,"length":81,"bombs":0,"notes":262,"obstacles":0,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Unravel","songSubName":"(TV Size)","songAuthorName":"TK","levelAuthorName":"winepic","bpm":135},"stats":{"downloads":444166,"plays":52247,"downVotes":369,"upVotes":4150,"heat":18.3311622,"rating":0.8851378895668524},"description":"Map made by me. Includes Hard and Expert difficulties.","deletedAt":null,"_id":"5cff620c48229f7d88fc60e5","key":"7","name":"Unravel (Tokyo Ghoul OP) TV Size","uploader":{"_id":"5cff0b7298cc5a672c84e8b6","username":"winepic"},"uploaded":"2018-05-08T16:25:10.000Z","hash":"b9867cdccf8b27d7a174c861adc69215c86cdab8","directDownload":"/cdn/7/b9867cdccf8b27d7a174c861adc69215c86cdab8.zip","downloadURL":"/api/download/key/7","coverURL":"/cdn/7/b9867cdccf8b27d7a174c861adc69215c86cdab8.png"},{"metadata":{"difficulties":{"easy":true,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":{"duration":265.510009765625,"length":189,"bombs":0,"notes":297,"obstacles":57,"njs":10,"njsOffset":0},"normal":{"duration":264.510009765625,"length":188,"bombs":0,"notes":358,"obstacles":62,"njs":10,"njsOffset":0},"hard":{"duration":266.010009765625,"length":190,"bombs":0,"notes":514,"obstacles":67,"njs":10,"njsOffset":0},"expert":{"duration":276.010009765625,"length":197,"bombs":0,"notes":681,"obstacles":67,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Clint Eastwood","songSubName":"Gorillaz","songAuthorName":"unknow","levelAuthorName":"freeek","bpm":84},"stats":{"downloads":471361,"plays":51819,"downVotes":372,"upVotes":5758,"heat":51.4893997,"rating":0.9075010599167767},"description":"Easy/Normal/Hard/Expert - Audio is as loud without clipping I swear! 100% Expert Playthrough: https://bit.ly/2LuFcxq\r\n\r\nHave fun! =D\r\n\r\n- Freeek =)","deletedAt":null,"_id":"5cff620c48229f7d88fc62e4","key":"225","name":"Clint Eastwood - Gorillaz","uploader":{"_id":"5cff0b7298cc5a672c84e8ad","username":"freeek"},"uploaded":"2018-05-25T20:58:36.000Z","hash":"507f0e09326d37e09dca08e3c2597f027dbe1940","directDownload":"/cdn/225/507f0e09326d37e09dca08e3c2597f027dbe1940.zip","downloadURL":"/api/download/key/225","coverURL":"/cdn/225/507f0e09326d37e09dca08e3c2597f027dbe1940.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":189,"length":90,"bombs":0,"notes":330,"obstacles":0,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Super Mario Bros. Theme (Overworld Theme)","songSubName":"Nintendo","songAuthorName":"red knight","levelAuthorName":"redknight","bpm":125},"stats":{"downloads":552611,"plays":49329,"downVotes":1093,"upVotes":4653,"heat":22.15705,"rating":0.7869063116417228},"description":"Expert only","deletedAt":null,"_id":"5cff620c48229f7d88fc6106","key":"29","name":"Super Mario Bros Theme","uploader":{"_id":"5cff0b7298cc5a672c84e917","username":"redknight"},"uploaded":"2018-05-10T16:34:12.000Z","hash":"c1c8e2b9394050afad435608137941da0b64b8f3","directDownload":"/cdn/29/c1c8e2b9394050afad435608137941da0b64b8f3.zip","downloadURL":"/api/download/key/29","coverURL":"/cdn/29/c1c8e2b9394050afad435608137941da0b64b8f3.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":472.5,"length":232,"bombs":0,"notes":373,"obstacles":11,"njs":10,"njsOffset":0},"hard":{"duration":472.5,"length":232,"bombs":0,"notes":503,"obstacles":14,"njs":10,"njsOffset":0},"expert":{"duration":472.5,"length":232,"bombs":0,"notes":682,"obstacles":30,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"Livin' On A Prayer","songSubName":"Bon Jovi","songAuthorName":"Bon Jovi","levelAuthorName":"jnua12345","bpm":122},"stats":{"downloads":472998,"plays":47593,"downVotes":840,"upVotes":2606,"heat":34.0630574,"rating":0.7341707864621012},"description":"Expert, Hard, Normal 122BPM","deletedAt":null,"_id":"5cff620c48229f7d88fc6194","key":"bd","name":"Bon Jovi - Livin' On A Prayer","uploader":{"_id":"5cff0b7298cc5a672c84e9da","username":"jnua12345"},"uploaded":"2018-05-17T01:12:03.000Z","hash":"4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88","directDownload":"/cdn/bd/4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88.zip","downloadURL":"/api/download/key/bd","coverURL":"/cdn/bd/4b47cccc819825f10ffbbf0d52ce2a00cc7a5f88.jpg"}],"totalDocs":35533,"lastPage":3553,"prevPage":null,"nextPage":1}"#.into());
client.maps_plays().await.unwrap();
}
#[async_test]
async fn test_user() {
let client = FakeClient::new(
BEATSAVER_URL
.join("api/users/find/5fbe7cd60192c700062b2a1f")
.unwrap(),
r#"{"_id":"5fbe7cd60192c700062b2a1f","username":"qw3rty01"}"#.into(),
);
client
.user("5fbe7cd60192c700062b2a1f".to_string())
.await
.unwrap();
}
#[async_test]
async fn test_search() {
let client = FakeClient::new(BEATSAVER_URL.join("api/search/text?q=datkami").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86172,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273593,"plays":31684,"downVotes":178,"upVotes":4248,"heat":21.0823944,"rating":0.923057857514794},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21773,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40640,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client.search("datkami".to_string()).await.unwrap();
}
#[async_test]
async fn test_search_advanced() {
let client = FakeClient::new(BEATSAVER_URL.join("api/search/advanced?q=metadata.levelAuthor%3Adatkami").unwrap(), r#"{"docs":[{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":true,"expert":false,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":{"duration":188.625,"length":141,"bombs":28,"notes":337,"obstacles":11,"njs":10,"njsOffset":0},"expert":null,"expertPlus":null}}],"songName":"me & u","songSubName":"","songAuthorName":"succducc","levelAuthorName":"datkami","bpm":160},"stats":{"downloads":86172,"plays":8377,"downVotes":110,"upVotes":512,"heat":17.2028038,"rating":0.7765731134313741},"description":"Hard Only / ~330 notes / Event Lighting! / https://soundcloud.com/succducc/me-n-u","deletedAt":null,"_id":"5cff620c48229f7d88fc60df","key":"1","name":"succducc - me & u","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-08T14:28:56.000Z","hash":"fda568fc27c20d21f8dc6f3709b49b5cc96723be","directDownload":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.zip","downloadURL":"/api/download/key/1","coverURL":"/cdn/1/fda568fc27c20d21f8dc6f3709b49b5cc96723be.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":291,"length":136,"bombs":4,"notes":353,"obstacles":15,"njs":10,"njsOffset":0},"hard":{"duration":291,"length":136,"bombs":4,"notes":455,"obstacles":15,"njs":10,"njsOffset":0},"expert":{"duration":291,"length":136,"bombs":10,"notes":526,"obstacles":15,"njs":10,"njsOffset":0},"expertPlus":null}}],"songName":"LUVORATORRRRRY!","songSubName":"feat.nqrse","songAuthorName":"Reol","levelAuthorName":"datkami","bpm":128},"stats":{"downloads":273593,"plays":31684,"downVotes":178,"upVotes":4248,"heat":21.0823944,"rating":0.923057857514794},"description":"Hard (353 notes) / Hard+ (455 notes) / Expert (526 notes) / 15 Obstacles / Video Demonstration: https://streamable.com/23ayv / Part 1 of the J-EDM Graduation series! Use this song pack to level up your game!","deletedAt":null,"_id":"5cff620c48229f7d88fc60fe","key":"21","name":"REOL feat. nqrse - LUVORATORRRRRY!","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-10T02:24:36.000Z","hash":"c807689fefdae82aa79ba9c7f861118fb426b4cc","directDownload":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.zip","downloadURL":"/api/download/key/21","coverURL":"/cdn/21/c807689fefdae82aa79ba9c7f861118fb426b4cc.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":true,"hard":true,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":{"duration":482,"length":199,"bombs":20,"notes":583,"obstacles":38,"njs":12,"njsOffset":0},"hard":{"duration":482,"length":199,"bombs":20,"notes":640,"obstacles":30,"njs":12,"njsOffset":0},"expert":{"duration":482,"length":199,"bombs":20,"notes":734,"obstacles":19,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Kodokushi","songSubName":"Kami","songAuthorName":"Mihka! x Kyoto Black","levelAuthorName":"datkami","bpm":145},"stats":{"downloads":21773,"plays":2937,"downVotes":17,"upVotes":327,"heat":30.7342061,"rating":0.87298999599274},"description":"Hard (583 Notes) / Hard+ (640 Notes) / Expert (734 Notes) / Event lighting! / Part 2 of the J-EDM Graduation series, a setlist of maps meant to help you bridge the gap between Hard and Expert! / Mapped by Kami#9635 / Video Demonstration: https://streamable.com/n3h12 / If you like the track, be sure to sign up for Beat Saver and give it a LIKE!","deletedAt":null,"_id":"5cff620c48229f7d88fc6171","key":"98","name":"Mihka! x Kyoto Black - Kodokushi","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-05-15T17:02:08.000Z","hash":"f829a801f10366ae4f61b8daabcf133209a65789","directDownload":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.zip","downloadURL":"/api/download/key/98","coverURL":"/cdn/98/f829a801f10366ae4f61b8daabcf133209a65789.jpg"},{"metadata":{"difficulties":{"easy":false,"normal":false,"hard":false,"expert":true,"expertPlus":false},"duration":0,"automapper":null,"characteristics":[{"name":"Standard","difficulties":{"easy":null,"normal":null,"hard":null,"expert":{"duration":655.5,"length":228,"bombs":28,"notes":865,"obstacles":31,"njs":12,"njsOffset":0},"expertPlus":null}}],"songName":"Coconut Cabana","songSubName":"Ikura","songAuthorName":"Kami","levelAuthorName":"datkami","bpm":172},"stats":{"downloads":40640,"plays":201,"downVotes":43,"upVotes":207,"heat":326.6865772,"rating":0.7658415646708089},"description":"172 BPM / Expert (865 notes) / my lights are pretty / Video Demonstration: https://streamable.com/2yo6w / shout out to @ikuratunes for making this bangin' track https://soundcloud.com/chunchunmarudesu/coconut-cabana","deletedAt":null,"_id":"5cff621048229f7d88fc73e2","key":"1a98","name":"ikura - Coconut Cabana","uploader":{"_id":"5cff0b7298cc5a672c84e8a3","username":"datkami"},"uploaded":"2018-10-16T23:53:48.000Z","hash":"023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f","directDownload":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.zip","downloadURL":"/api/download/key/1a98","coverURL":"/cdn/1a98/023ae70b643a2abe62c9dbc9e3fdfd9c325f0f1f.jpg"}],"totalDocs":4,"lastPage":0,"prevPage":null,"nextPage":null}"#.into());
client
.search_advanced("metadata.levelAuthor:datkami".to_string())
.await
.unwrap();
}
#[async_test]
async fn test_download() {
let client = FakeClient::new(
BEATSAVER_URL.join("api/download/key/1").unwrap(),
"map #1".into(),
);
client.download("1".try_into().unwrap()).await.unwrap();
let client = FakeClient::new(
BEATSAVER_URL
.join("api/download/hash/fda568fc27c20d21f8dc6f3709b49b5cc96723be")
.unwrap(),
"map #1".into(),
);
client
.download(
"fda568fc27c20d21f8dc6f3709b49b5cc96723be"
.try_into()
.unwrap(),
)
.await
.unwrap();
}
}
}