From 2e3e55406bc86942a88be2b5de4f45ac4495493e Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 11 Feb 2022 17:49:32 +0100 Subject: [PATCH] Fix init when settings path doesn't exist Signed-off-by: trivernis --- mediarepo-daemon/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mediarepo-daemon/src/main.rs b/mediarepo-daemon/src/main.rs index 757dffe..55f608d 100644 --- a/mediarepo-daemon/src/main.rs +++ b/mediarepo-daemon/src/main.rs @@ -55,7 +55,14 @@ fn main() -> RepoResult<()> { let settings = if opt.repo.exists() { opt.repo = opt.repo.canonicalize().unwrap(); - load_settings(&opt.repo)? + + match load_settings(&opt.repo) { + Ok(s) => s, + Err(e) => { + log::warn!("failed to read settings {}", e); + Settings::default() + } + } } else { Settings::default() };