From f27bc63d9d3de8d919a5a81e01e9a022de89cdf2 Mon Sep 17 00:00:00 2001 From: Zed Date: Thu, 15 Aug 2019 18:41:35 +0200 Subject: [PATCH] Add compile-time variable for default hostname --- src/prefs.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/prefs.nim b/src/prefs.nim index 8451fc8..d73977b 100644 --- a/src/prefs.nim +++ b/src/prefs.nim @@ -1,6 +1,8 @@ import asyncdispatch, times, macros, tables, xmltree import types +const hostname {.strdefine.} = "nitter.net" + withCustomDb("prefs.db", "", "", ""): try: createTables() @@ -24,11 +26,12 @@ type defaultInput*: string placeholder*: string +# TODO: write DSL to simplify this const prefList*: Table[string, seq[Pref]] = { "Privacy": @[ Pref(kind: input, name: "replaceTwitter", label: "Replace Twitter links with Nitter (blank to disable)", - defaultInput: "nitter.net", placeholder: "Nitter hostname"), + defaultInput: hostname, placeholder: "Nitter hostname"), Pref(kind: input, name: "replaceYouTube", label: "Replace YouTube links with Invidious (blank to disable)",