mirror of
https://github.com/versia-pub/activitypub.git
synced 2025-12-06 06:38:20 +01:00
fix: migration stuff
This commit is contained in:
parent
4429aa380a
commit
451cf8941a
|
|
@ -159,7 +159,10 @@ pub async fn lysand_user_from_db(
|
|||
let mut emojis = Vec::new();
|
||||
for tag in tags {
|
||||
let mut content_format = ContentFormat::default();
|
||||
let content_entry = ContentEntry::from_string(tag.id.to_string());
|
||||
if tag.id.is_none() {
|
||||
continue;
|
||||
}
|
||||
let content_entry = ContentEntry::from_string(tag.id.unwrap().to_string());
|
||||
content_format.x.insert(tag.type_, content_entry);
|
||||
emojis.push(super::objects::CustomEmoji {
|
||||
name: tag.name,
|
||||
|
|
@ -314,15 +317,16 @@ pub async fn db_user_from_url(url: Url) -> anyhow::Result<entities::user::Model>
|
|||
for emoji in custom_emojis.emojis {
|
||||
let touple = emoji.url.select_rich_img_touple().await?;
|
||||
tags.push(TagType {
|
||||
id: Url::parse(&touple.1).unwrap(),
|
||||
id: Some(Url::parse(&touple.1).unwrap()),
|
||||
name: emoji.name,
|
||||
type_: "Emoji".to_string(),
|
||||
updated: Utc::now(),
|
||||
icon: IconType {
|
||||
updated: Some(Utc::now()),
|
||||
href: None,
|
||||
icon: Some(IconType {
|
||||
type_: "Image".to_string(),
|
||||
media_type: touple.0,
|
||||
url: Url::parse(&touple.1).unwrap(),
|
||||
},
|
||||
}),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,12 +95,13 @@ pub struct Person {
|
|||
}
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct TagType {
|
||||
pub id: Url,
|
||||
pub id: Option<Url>,
|
||||
pub href: Option<Url>,
|
||||
pub name: String,
|
||||
#[serde(rename = "type")]
|
||||
pub type_: String,
|
||||
pub updated: DateTime<Utc>,
|
||||
pub icon: IconType,
|
||||
pub updated: Option<DateTime<Utc>>,
|
||||
pub icon: Option<IconType>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue