mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Create files for configuration
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
mod get_manifests;
|
||||
mod manifest_item;
|
||||
mod settings;
|
||||
pub use manifest_item::*;
|
||||
pub use get_manifests::get_egs_manifests;
|
||||
@@ -0,0 +1,29 @@
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct EpicGamesLauncher {
|
||||
enabled: bool,
|
||||
location: Option<String>,
|
||||
}
|
||||
|
||||
impl Default for EpicGamesLauncher {
|
||||
fn default() -> Self {
|
||||
|
||||
// On windows
|
||||
// Even if no path is given, we can try to guess, so lets enable by default
|
||||
#[cfg(target_os = "windows")]
|
||||
let enabled = true;
|
||||
|
||||
|
||||
// On linux
|
||||
// We can notguess, so lets not enable by default
|
||||
#[cfg(target_os = "linux")]
|
||||
let enabled = false;
|
||||
|
||||
EpicGamesLauncher {
|
||||
enabled,
|
||||
location: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ use std::{
|
||||
mod cached_search;
|
||||
mod egs;
|
||||
mod legendary;
|
||||
mod steamgriddb;
|
||||
|
||||
use crate::legendary::get_legendary_games;
|
||||
use egs::{get_egs_manifests, ManifestItem};
|
||||
use std::error::Error;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
use std::env;
|
||||
use config::{ConfigError, Config, File, Environment};
|
||||
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Settings {
|
||||
debug: bool,
|
||||
database: EpicGamesLauncher,
|
||||
}
|
||||
|
||||
//https://github.com/JosefNemec/Playnite/tree/master/source/Plugins/OriginLibrary
|
||||
//https://github.com/JosefNemec/Playnite/blob/master/source/Plugins/OriginLibrary/Origin.cs#L109
|
||||
impl Settings {
|
||||
|
||||
pub fn new() -> Result<Self, ConfigError> {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
mod settings;
|
||||
pub use settings::*;
|
||||
@@ -0,0 +1,16 @@
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct SteamGridDb {
|
||||
pub enabled: bool,
|
||||
pub auth_key: Option<String>,
|
||||
}
|
||||
|
||||
impl Default for SteamGridDb {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: true,
|
||||
auth_key: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user