Remove hardcoded replaceYouTube config fallback

This commit is contained in:
Zed 2021-12-30 01:55:55 +01:00
parent 80f7bc0a02
commit 7590dc1cda
1 changed files with 3 additions and 5 deletions

View File

@ -2,8 +2,8 @@
import parsecfg except Config import parsecfg except Config
import types, strutils import types, strutils
proc get*[T](config: parseCfg.Config; s, v: string; default: T): T = proc get*[T](config: parseCfg.Config; section, key: string; default: T): T =
let val = config.getSectionValue(s, v) let val = config.getSectionValue(section, key)
if val.len == 0: return default if val.len == 0: return default
when T is int: parseInt(val) when T is int: parseInt(val)
@ -37,9 +37,7 @@ proc getConfig*(path: string): (Config, parseCfg.Config) =
redisPort: cfg.get("Cache", "redisPort", 6379), redisPort: cfg.get("Cache", "redisPort", 6379),
redisConns: cfg.get("Cache", "redisConnections", 20), redisConns: cfg.get("Cache", "redisConnections", 20),
redisMaxConns: cfg.get("Cache", "redisMaxConnections", 30), redisMaxConns: cfg.get("Cache", "redisMaxConnections", 30),
redisPassword: cfg.get("Cache", "redisPassword", ""), redisPassword: cfg.get("Cache", "redisPassword", "")
replaceYouTube: cfg.get("Preferences", "replaceYouTube", "piped.kavin.rocks")
) )
return (conf, cfg) return (conf, cfg)