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,20 +103,22 @@ impl Actor for ImportCardActor {
.result?
.attachments;
for trello_attachment in attachments.into_iter() {
let trello_attachment_name = trello_attachment.name.clone();
let child = spawn_in_thread!(
actor_ref,
ImportAttachmentActor::new(
this.ctx.clone(),
this.nextcloud_board_id,
this.nextcloud_stack_id,
nextcloud_card.id,
this.trello_card.id.clone(),
trello_attachment,
)
);
this.attachments_children
.insert(child.id(), (trello_attachment_name, child.clone()));
if trello_attachment.is_upload {
let trello_attachment_name = trello_attachment.name.clone();
let child = spawn_in_thread!(
actor_ref,
ImportAttachmentActor::new(
this.ctx.clone(),
this.nextcloud_board_id,
this.nextcloud_stack_id,
nextcloud_card.id,
this.trello_card.id.clone(),
trello_attachment,
)
);
this.attachments_children
.insert(child.id(), (trello_attachment_name, child.clone()));
}
}
if this.labels_children.is_empty() && this.attachments_children.is_empty() {

View file

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