From de982192009320d55a22869787b2375b186aa7cb Mon Sep 17 00:00:00 2001 From: seanomik Date: Sun, 19 Jun 2022 14:33:07 -0500 Subject: [PATCH] Created more members of Config struct --- src/config/config.rs | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/config/config.rs b/src/config/config.rs index 686670f..b35fadf 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -9,16 +9,37 @@ use crate::torznab::TorznabClient; use super::CliProvider; +#[derive(Debug, Clone)] +pub enum RunMode { + Script, + Daemon, +} + +#[derive(Debug, Clone)] +pub enum TorrentMode { + Inject, + Search, +} + #[derive(Deserialize, Serialize)] pub struct Config { /// The path of the torrents to search. torrents_path: String, /// The output path of the torrents. - output_path: Option, - + output_path: Option, + /// Whether or not to strip public trackers from cross-seed torrents. + strip_public: bool, + /// When running as script we exit the program after finishing. In daemon mode we run it at set intervals. + run_mode: RunMode, + /// When running as inject we inject torrents cross-seed has found directly into the client, when running as search we populate the output folder. + torrent_mode: TorrentMode, + /// Whether to cache using an external db (ie regis) or don't cache. + use_cache: bool, + /// Whether to keep the original torrent file and create a new one for cross-seed or delete original and upload cross-seed + replace_torrents: bool, + //pub indexers: HashMap, - /// Used for deserializing the indexers into a Vec. #[serde(rename = "indexers")] indexers_map: HashMap, @@ -31,9 +52,13 @@ pub struct Config { #[derive(Debug, Clone, Deserialize, Serialize)] pub struct Indexer { #[serde(skip_deserializing)] + /// Name of the indexer pub name: String, + /// Whether the indexer is enabled or not for searching pub enabled: Option, + /// URL to query for searches pub url: String, + /// API key to pass to prowlarr/jackett pub api_key: String, #[serde(skip)]