Add basic dlsite crawler

Reformat application config
This commit is contained in:
2025-10-18 01:32:00 +08:00
parent fea4e8d35e
commit 27bee0cfde
10 changed files with 922 additions and 166 deletions

View File

@@ -7,6 +7,14 @@ use serde_json;
pub mod types;
impl ApplicationConfig {
pub fn get_config() -> Result<Self> {
if APP_CONIFG_FILE_PATH.exists() {
ApplicationConfig::from_file(&APP_CONIFG_FILE_PATH)
} else {
Ok(ApplicationConfig::new())
}
}
pub fn from_file(path: &PathBuf) -> Result<Self> {
let reader = std::fs::File::open(path)?;
let result = serde_json::from_reader(reader)?;