remove deprecated path field and add ipfs field on meme struct
This commit is contained in:
parent
d4a8b33dd0
commit
fb10405a3b
|
@ -35,16 +35,16 @@ pub struct Category {
|
|||
pub struct Meme {
|
||||
pub id: String,
|
||||
pub link: String,
|
||||
pub path: String,
|
||||
pub category: String,
|
||||
pub user: String,
|
||||
#[serde(deserialize_with = "deserialize_timestamp")]
|
||||
pub timestamp: i64,
|
||||
pub ipfs: Option<String>,
|
||||
}
|
||||
|
||||
impl Meme {
|
||||
pub fn file_name(&self) -> Result<&str> {
|
||||
self.path
|
||||
self.link
|
||||
.split('/')
|
||||
.last()
|
||||
.ok_or_else(|| anyhow!("failed to get file name. server response invalid"))
|
||||
|
|
Loading…
Reference in a new issue