Compare commits

..

No commits in common. "e1911be63c995479c625bb3f462c12dc434882fc" and "51f769690961208a86ea3b35fa0f6b176faa89ed" have entirely different histories.

View file

@ -40,14 +40,13 @@ impl From<ScoredChatMessage> for Markup {
fn from(item: ScoredChatMessage) -> Markup {
if let Some(mime_type) = &item.chat_message.mime_type {
let message_file = item.chat_message.file.expect("No sticker file");
let message_emoji = item.chat_message.sticker_emoji.unwrap_or(String::from("No emote"));
let message_date = item.last_used;
match mime_type.as_str() {
"image/webp" => {
return html! {
.sticker {
img loading="lazy" src=(message_file);
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) br; (message_emoji) }
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) }
}
};
}
@ -55,7 +54,7 @@ impl From<ScoredChatMessage> for Markup {
return html! {
.sticker.animated {
video loading="lazy" autoplay loop controls src=(message_file) {}
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) br; (message_emoji) }
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) }
}
}
}
@ -63,7 +62,7 @@ impl From<ScoredChatMessage> for Markup {
return html! {
.sticker.animated {
tgs-player loading="lazy" autoplay loop controls src=(message_file) {}
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) br; (message_emoji) }
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) }
}
}
}
@ -88,7 +87,6 @@ struct ChatMessage {
pub media_type: Option<MediaType>,
pub mime_type: Option<String>,
pub file: Option<String>,
pub sticker_emoji: Option<String>,
pub date_unixtime: String,
pub date: String
}