Created more members of Config struct

This commit is contained in:
seanomik 2022-06-19 14:33:07 -05:00 committed by SeanOMik
parent 6741d35783
commit de98219200
Signed by: SeanOMik
GPG Key ID: 568F326C7EB33ACB
1 changed files with 28 additions and 3 deletions

View File

@ -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<String>,
output_path: Option<String>,
/// 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<String, Indexer>,
/// Used for deserializing the indexers into a Vec<Indexer>.
#[serde(rename = "indexers")]
indexers_map: HashMap<String, FigmentValue>,
@ -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<bool>,
/// URL to query for searches
pub url: String,
/// API key to pass to prowlarr/jackett
pub api_key: String,
#[serde(skip)]