From f57592a0ff38fb5b7418438d4804fc4ec0a4ae3a Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sun, 25 Oct 2026 19:55:27 +0100 Subject: feat(fdroid): set langs and tags for posts --- src/bots/fdroid/mod.rs | 5 ++++- src/main.rs | 4 ++-- src/report.rs | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') 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) -> Result, 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) -> Result, 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, 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, /// Images to upload before creating the post record. pub images: Vec, + pub langs: Vec, + pub tags: Vec, } pub(crate) struct PostImage { -- cgit v1.3.1