diff options
| author | Martin Fischer <martin@push-f.com> | 2026-10-25 19:55:27 +0100 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2026-10-25 20:02:36 +0100 |
| commit | f57592a0ff38fb5b7418438d4804fc4ec0a4ae3a (patch) | |
| tree | 8a492b157dc4a83bb74a1cb1249fbcb858df2be2 | |
| parent | 41212a7a15198e53d205252a02069a7dd6ddadeb (diff) | |
feat(fdroid): set langs and tags for posts
| -rw-r--r-- | src/bots/fdroid/mod.rs | 5 | ||||
| -rw-r--r-- | src/main.rs | 4 | ||||
| -rw-r--r-- | src/report.rs | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/bots/fdroid/mod.rs b/src/bots/fdroid/mod.rs index c0e7198..d6cd612 100644 --- a/src/bots/fdroid/mod.rs +++ b/src/bots/fdroid/mod.rs @@ -3,7 +3,7 @@ mod index; use atrium_api::app::bsky::richtext::facet::{ByteSliceData, LinkData, MainData, MainFeaturesItem}; -use atrium_api::types::Union; +use atrium_api::types::{Union, string::Language}; use reqwest::{ StatusCode, header::{ETAG, IF_NONE_MATCH}, @@ -428,6 +428,7 @@ impl PostBuilder { async fn download_images(pending_posts: Vec<PendingPost>) -> Result<Vec<Post>, String> { let client = http_client(); + let english: Language = "en".parse().unwrap(); let mut posts = Vec::with_capacity(pending_posts.len()); for (post_index, post) in pending_posts.into_iter().enumerate() { @@ -463,6 +464,8 @@ async fn download_images(pending_posts: Vec<PendingPost>) -> Result<Vec<Post>, S text: post.text, facets: post.facets, images, + langs: vec![english.clone()], + tags: vec!["F-Droid".to_owned()], }); } diff --git a/src/main.rs b/src/main.rs index 0a5b264..f2dfc52 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,11 +171,11 @@ async fn publish(posts: Vec<Post>, credentials: Credentials) -> Result<(), Strin text: post.text, facets: Some(post.facets), embed, + langs: Some(post.langs), + tags: Some(post.tags), entities: None, labels: None, - langs: None, reply: None, - tags: None, }); } diff --git a/src/report.rs b/src/report.rs index d776469..07305a1 100644 --- a/src/report.rs +++ b/src/report.rs @@ -1,6 +1,6 @@ use std::{fs, io, path::Path}; -use atrium_api::app::bsky::richtext::facet::Main as Facet; +use atrium_api::{app::bsky::richtext::facet::Main as Facet, types::string::Language}; use serde::{Serialize, de::DeserializeOwned}; pub(crate) struct Post { @@ -8,6 +8,8 @@ pub(crate) struct Post { pub facets: Vec<Facet>, /// Images to upload before creating the post record. pub images: Vec<PostImage>, + pub langs: Vec<Language>, + pub tags: Vec<String>, } pub(crate) struct PostImage { |
