mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 07:09:31 +00:00
Add Invidious/Nitter link replacement preferences
This commit is contained in:
parent
93da24be85
commit
7dfbc16f4c
6 changed files with 41 additions and 16 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import asyncdispatch, times, macros, tables
|
||||
import asyncdispatch, times, macros, tables, xmltree
|
||||
import types
|
||||
|
||||
withCustomDb("prefs.db", "", "", ""):
|
||||
|
|
@ -25,6 +25,16 @@ type
|
|||
placeholder*: string
|
||||
|
||||
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"),
|
||||
|
||||
Pref(kind: input, name: "replaceYouTube",
|
||||
label: "Replace YouTube links with Invidious (blank to disable)",
|
||||
defaultInput: "invidio.us", placeholder: "Invidious hostname")
|
||||
],
|
||||
|
||||
"Media": @[
|
||||
Pref(kind: checkbox, name: "videoPlayback",
|
||||
label: "Enable hls.js video playback (requires JavaScript)",
|
||||
|
|
@ -94,7 +104,7 @@ macro genUpdatePrefs*(): untyped =
|
|||
of checkbox:
|
||||
result.add quote do: prefs.`ident` = `value` == "on"
|
||||
of input:
|
||||
result.add quote do: prefs.`ident` = `value`
|
||||
result.add quote do: prefs.`ident` = xmltree.escape(strip(`value`))
|
||||
of select:
|
||||
let options = pref.options
|
||||
let default = pref.defaultOption
|
||||
|
|
|
|||
Loading…
Reference in a new issue