Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
Add primal image url to wasm model
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jan 29, 2024
1 parent a8b07f5 commit 38f31a2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mutiny-wasm/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,16 @@ impl TagItem {
pub fn image_url(&self) -> Option<String> {
self.image_url.clone()
}

#[wasm_bindgen(getter)]
pub fn primal_image_url(&self) -> Option<String> {
self.image_url.as_ref().map(|i| {
format!(
"https://primal.b-cdn.net/media-cache?s=s&a=1&u=${}",
urlencoding::encode(i)
)
})
}
}

impl From<(String, MutinyContact)> for TagItem {
Expand Down

0 comments on commit 38f31a2

Please sign in to comment.