Add a Bitmagnet import action
This commit is contained in:
parent
8eda807ead
commit
d26931f4c6
15 changed files with 402 additions and 10 deletions
20
src/main.rs
20
src/main.rs
|
|
@ -1,4 +1,5 @@
|
|||
use crate::actions::action::Action;
|
||||
use crate::actions::bitmagnet::BitmagnetAction;
|
||||
use crate::actions::transmission::TransmissionAction;
|
||||
use crate::args::Args;
|
||||
use crate::config::{get_db_path, load_config};
|
||||
|
|
@ -133,6 +134,25 @@ async fn main() -> Result<()> {
|
|||
// Initialize actions
|
||||
let mut actions: Vec<Box<dyn Action>> = Vec::new();
|
||||
|
||||
// Add Bitmagnet action if enabled
|
||||
if let Some(bitmagnet_config) = conf.bitmagnet {
|
||||
if bitmagnet_config.enable {
|
||||
info!("Initializing Bitmagnet action");
|
||||
match BitmagnetAction::new(&bitmagnet_config).await {
|
||||
Ok(bitmagnet_action) => {
|
||||
actions.push(Box::new(bitmagnet_action));
|
||||
}
|
||||
Err(e) => {
|
||||
warn!("Failed to initialize Bitmagnet action: {}", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
debug!("Bitmagnet action is disabled");
|
||||
}
|
||||
} else {
|
||||
debug!("No Bitmagnet configuration found");
|
||||
}
|
||||
|
||||
// Add Transmission action if enabled
|
||||
if let Some(transmission_config) = conf.transmission {
|
||||
if transmission_config.enable {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue