From f72e9e12214343fea6d0408fcff7d321706a055b Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 22 Dec 2024 15:58:04 +0000 Subject: [PATCH] chore: remove dead code --- src/import/attachment.rs | 44 ------------------------------ src/import/card.rs | 59 ---------------------------------------- src/import/labels.rs | 50 ---------------------------------- 3 files changed, 153 deletions(-) diff --git a/src/import/attachment.rs b/src/import/attachment.rs index 6e19ba6..78ee044 100644 --- a/src/import/attachment.rs +++ b/src/import/attachment.rs @@ -13,50 +13,6 @@ use crate::{ FullCtx, }; -// pub(super) async fn import_attachment( -// ctx: &FullCtx, -// nextcloud_board_id: NextcloudBoardId, -// nextcloud_stack_id: NextcloudStackId, -// trello_card: &TrelloShortCard, -// nextcloud_card: &Card, -// trello_attachment: &TrelloAttachment, -// ) -> color_eyre::Result<()> { -// let trello_client: TrelloClient = ctx.trello_client(); -// -// let deck_client: DeckClient = ctx.deck_client(); -// -// p!(ctx.prt, ">> Adding attachment: {}", trello_attachment.name); -// // - - - download the attachment from trello -// let attachment_path = trello_client -// .save_attachment( -// &trello_card.id, -// &TrelloAttachmentId::new(&trello_attachment.id), -// Some(&PathBuf::from(&trello_attachment.id)), -// ) -// .await?; -// let attachment_file = ctx.fs.file(&attachment_path); -// // - - - upload the attachment to nextcloud card -// let attachment = deck_client -// .add_attachment_to_card( -// nextcloud_board_id, -// nextcloud_stack_id, -// nextcloud_card.id, -// &attachment_file, -// ) -// .await -// .result?; -// p!( -// ctx.prt, -// ">> Attachment added: {}:{}", -// attachment.id, -// attachment.attachment_type, -// // attachment.extended_data.mimetype -// ); -// // delete local copy of attachment -// attachment_file.remove()?; -// Ok(()) -// } - pub(crate) struct ImportAttachmentActor { ctx: FullCtx, nextcloud_board_id: NextcloudBoardId, diff --git a/src/import/card.rs b/src/import/card.rs index f201338..2d43fa7 100644 --- a/src/import/card.rs +++ b/src/import/card.rs @@ -19,65 +19,6 @@ use crate::{ FullCtx, }; -// pub(super) async fn import_card( -// ctx: &FullCtx, -// nextcloud_board_id: NextcloudBoardId, -// nextcloud_labels: &mut HashMap, -// nextcloud_stack_id: NextcloudStackId, -// trello_card: &TrelloShortCard, -// ) -> color_eyre::Result<()> { -// let trello_client: TrelloClient = ctx.trello_client(); -// -// let deck_client: DeckClient = ctx.deck_client(); -// -// p!(ctx.prt, "> Importing card: {}", trello_card.name); -// // - - create a nextcloud card -// let title = NextcloudCardTitle::from(&trello_card.name); -// let desc: Option = match trello_card.desc.len() { -// 0 => None, -// _ => Some(NextcloudCardDescription::from(&trello_card.desc)), -// }; -// let nextcloud_card = deck_client -// .create_card( -// nextcloud_board_id, -// nextcloud_stack_id, -// &title, -// desc.as_ref(), -// ) -// .await -// .result?; -// // - - for each label on the trello card -// for trello_label in trello_card.labels.iter() { -// labels::import_label( -// ctx, -// nextcloud_board_id, -// nextcloud_labels, -// nextcloud_stack_id, -// &nextcloud_card, -// trello_label, -// ) -// .await?; -// } -// // - - for each attachment on the trello card -// let attachments = trello_client -// .card(&trello_card.id) -// .await -// .result? -// .attachments; -// for trello_attachment in attachments.iter() { -// attachment::import_attachment( -// ctx, -// nextcloud_board_id, -// nextcloud_stack_id, -// trello_card, -// &nextcloud_card, -// trello_attachment, -// ) -// .await?; -// } -// Ok(()) -// } - pub(crate) struct ImportCardActor { ctx: FullCtx, trello_card: TrelloShortCard, diff --git a/src/import/labels.rs b/src/import/labels.rs index 6aa622a..df8c52e 100644 --- a/src/import/labels.rs +++ b/src/import/labels.rs @@ -17,56 +17,6 @@ use crate::{ FullCtx, }; -// pub(super) async fn import_label( -// ctx: &FullCtx, -// nextcloud_board_id: NextcloudBoardId, -// nextcloud_labels: &mut HashMap, -// nextcloud_stack_id: NextcloudStackId, -// nextcloud_card: &Card, -// trello_label: &TrelloLabel, -// ) -> color_eyre::Result<()> { -// let deck_client: DeckClient = ctx.deck_client(); -// -// p!( -// ctx.prt, -// ">> Adding label: {} ({})", -// trello_label.name, -// trello_label.color -// ); -// // - - - find the equivalent label in nextcloud -// let nextcloud_label: &Label = -// match nextcloud_labels.get(&NextcloudLabelTitle::new(trello_label.name.as_ref())) { -// Some(label) => label, -// None => { -// p!(ctx.prt, ">> Label not found in nextcloud board, creating"); -// -// let label = deck_client -// .create_label( -// nextcloud_board_id, -// &NextcloudLabelTitle::new(trello_label.name.as_ref()), -// &NextcloudLabelColour::new(get_color_hex(trello_label.color.as_ref())), -// ) -// .await -// .result?; -// nextcloud_labels.insert(label.title.clone(), label); -// nextcloud_labels -// .get(&NextcloudLabelTitle::new(trello_label.name.as_ref())) -// .expect("label was just inserted") -// } -// }; -// // - - - add the label to the nextcloud card -// deck_client -// .add_label_to_card( -// nextcloud_board_id, -// nextcloud_stack_id, -// nextcloud_card.id, -// nextcloud_label.id, -// ) -// .await -// .result?; -// Ok(()) -// } - pub(super) struct LabelsActor { ctx: FullCtx, nextcloud_board_id: NextcloudBoardId,