chore: remove dead code
Some checks failed
Test / build (map[name:stable]) (push) Successful in 2m15s
Test / build (map[name:nightly]) (push) Successful in 2m37s
Release Please / Release-plz (push) Failing after 26s

This commit is contained in:
Paul Campbell 2024-12-22 15:58:04 +00:00
parent 1568b7e08a
commit f72e9e1221
3 changed files with 0 additions and 153 deletions

View file

@ -13,50 +13,6 @@ use crate::{
FullCtx, 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 { pub(crate) struct ImportAttachmentActor {
ctx: FullCtx, ctx: FullCtx,
nextcloud_board_id: NextcloudBoardId, nextcloud_board_id: NextcloudBoardId,

View file

@ -19,65 +19,6 @@ use crate::{
FullCtx, FullCtx,
}; };
// pub(super) async fn import_card(
// ctx: &FullCtx,
// nextcloud_board_id: NextcloudBoardId,
// nextcloud_labels: &mut HashMap<NextcloudLabelTitle, Label>,
// 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<NextcloudCardDescription> = 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 { pub(crate) struct ImportCardActor {
ctx: FullCtx, ctx: FullCtx,
trello_card: TrelloShortCard, trello_card: TrelloShortCard,

View file

@ -17,56 +17,6 @@ use crate::{
FullCtx, FullCtx,
}; };
// pub(super) async fn import_label(
// ctx: &FullCtx,
// nextcloud_board_id: NextcloudBoardId,
// nextcloud_labels: &mut HashMap<NextcloudLabelTitle, Label>,
// 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 { pub(super) struct LabelsActor {
ctx: FullCtx, ctx: FullCtx,
nextcloud_board_id: NextcloudBoardId, nextcloud_board_id: NextcloudBoardId,