Created more members of Config struct
This commit is contained in:
parent
6741d35783
commit
de98219200
|
@ -9,16 +9,37 @@ use crate::torznab::TorznabClient;
|
||||||
|
|
||||||
use super::CliProvider;
|
use super::CliProvider;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub enum RunMode {
|
||||||
|
Script,
|
||||||
|
Daemon,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub enum TorrentMode {
|
||||||
|
Inject,
|
||||||
|
Search,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
/// The path of the torrents to search.
|
/// The path of the torrents to search.
|
||||||
torrents_path: String,
|
torrents_path: String,
|
||||||
/// The output path of the torrents.
|
/// 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>,
|
//pub indexers: HashMap<String, Indexer>,
|
||||||
|
|
||||||
|
|
||||||
/// Used for deserializing the indexers into a Vec<Indexer>.
|
/// Used for deserializing the indexers into a Vec<Indexer>.
|
||||||
#[serde(rename = "indexers")]
|
#[serde(rename = "indexers")]
|
||||||
indexers_map: HashMap<String, FigmentValue>,
|
indexers_map: HashMap<String, FigmentValue>,
|
||||||
|
@ -31,9 +52,13 @@ pub struct Config {
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||||
pub struct Indexer {
|
pub struct Indexer {
|
||||||
#[serde(skip_deserializing)]
|
#[serde(skip_deserializing)]
|
||||||
|
/// Name of the indexer
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
/// Whether the indexer is enabled or not for searching
|
||||||
pub enabled: Option<bool>,
|
pub enabled: Option<bool>,
|
||||||
|
/// URL to query for searches
|
||||||
pub url: String,
|
pub url: String,
|
||||||
|
/// API key to pass to prowlarr/jackett
|
||||||
pub api_key: String,
|
pub api_key: String,
|
||||||
|
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
|
|
Loading…
Reference in New Issue