Skip to content

Commit 8fc2f30

Browse files
author
Kile
committed
πŸ› Fix cardinfo bug + new hugs
1 parent a07a42a commit 8fc2f30

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

β€Žapi/src/routes/cards.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ pub struct Card<'a> {
1919
limit: u32,
2020
r#type: Cow<'a, str>,
2121
available: bool,
22+
class: Option<Vec<Cow<'a, str>>>,
23+
range: Option<Cow<'a, str>>,
2224
}
2325

2426
static CENSORED_CACHE: OnceCell<Json<Vec<Card<'static>>>> = OnceCell::const_new();
@@ -67,6 +69,8 @@ pub async fn get_public_cards() -> Result<Json<Vec<Card<'static>>>, BadRequest<J
6769
ref t if t =="monster" => Cow::Borrowed("/image/cards/PLACEHOLDER_NORMAL.png"),
6870
_ => Cow::Borrowed("/image/cards/PLACEHOLDER_NORMAL.png")
6971
};
72+
card.class = card.class.map(|_| vec![Cow::Borrowed("X")]);
73+
card.range = card.range.map(|_| Cow::Borrowed("X"));
7074
card
7175
}).collect();
7276
Ok(Json(cards))

β€Žapi/src/routes/common/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn make_request_inner<'a, T: Serialize + Deserialize<'a>>(
7272
Ok(msg.as_str().unwrap().to_string())
7373
}
7474

75-
pub async fn make_request<'b, T: Serialize + std::marker::Send + Deserialize<'static> + 'static>(
75+
pub async fn make_request<T: Serialize + std::marker::Send + Deserialize<'static> + 'static>(
7676
route: &'static str,
7777
data: T,
7878
) -> Result<String, zmq::Error> {

β€Žhugs.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,37 @@
12211221
"url": "/image/hugs/156.jpg",
12221222
"artist": null,
12231223
"featured": false
1224+
},
1225+
{
1226+
"url": "/image/hugs/157.jpeg",
1227+
"artist": {
1228+
"name": "けょこぱい",
1229+
"link": "https://x.com/sha_nato"
1230+
},
1231+
"featured": false
1232+
},
1233+
{
1234+
"url": "/image/hugs/158.jpeg",
1235+
"artist": {
1236+
"name": "けょこぱい",
1237+
"link": "https://x.com/sha_nato"
1238+
},
1239+
"featured": false
1240+
},
1241+
{
1242+
"url": "/image/hugs/159.jpeg",
1243+
"artist": {
1244+
"name": "けょこぱい",
1245+
"link": "https://x.com/sha_nato"
1246+
},
1247+
"featured": false
1248+
},
1249+
{
1250+
"url": "/image/hugs/160.jpeg",
1251+
"artist": {
1252+
"name": "いもっこレジェンド",
1253+
"link": "https://x.com/7uXacFPL7L38301"
1254+
},
1255+
"featured": false
12241256
}
1225-
12261257
]

0 commit comments

Comments
Β (0)