fix: only upload attachments that are files
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 4m3s
Test / build (map[name:stable]) (push) Successful in 4m12s
Release Please / Release-plz (push) Failing after 33s

This commit is contained in:
Paul Campbell 2024-12-22 21:13:22 +00:00
parent b3f1ed596c
commit fa7d565238
2 changed files with 18 additions and 14 deletions

View file

@ -103,6 +103,7 @@ impl Actor for ImportCardActor {
.result? .result?
.attachments; .attachments;
for trello_attachment in attachments.into_iter() { for trello_attachment in attachments.into_iter() {
if trello_attachment.is_upload {
let trello_attachment_name = trello_attachment.name.clone(); let trello_attachment_name = trello_attachment.name.clone();
let child = spawn_in_thread!( let child = spawn_in_thread!(
actor_ref, actor_ref,
@ -118,6 +119,7 @@ impl Actor for ImportCardActor {
this.attachments_children this.attachments_children
.insert(child.id(), (trello_attachment_name, child.clone())); .insert(child.id(), (trello_attachment_name, child.clone()));
} }
}
if this.labels_children.is_empty() && this.attachments_children.is_empty() { if this.labels_children.is_empty() && this.attachments_children.is_empty() {
Ok(actor_ref.stop_gracefully().await?) Ok(actor_ref.stop_gracefully().await?)

View file

@ -26,4 +26,6 @@ pub(crate) struct TrelloAttachment {
pub(crate) url: TrelloAttachmentUrl, //"https://admin.typeform.com/form/RzExEM/share#/link", pub(crate) url: TrelloAttachmentUrl, //"https://admin.typeform.com/form/RzExEM/share#/link",
#[serde(rename = "fileName")] #[serde(rename = "fileName")]
pub(crate) file_name: TrelloAttachmentFilename, pub(crate) file_name: TrelloAttachmentFilename,
#[serde(rename = "isUpload")]
pub(crate) is_upload: bool,
} }