Zed 4 år sedan
förälder
incheckning
74c4377198
7 ändrade filer med 11 tillägg och 11 borttagningar
  1. 1 1
      src/apiutils.nim
  2. 2 2
      src/http_pool.nim
  3. 1 1
      src/prefs.nim
  4. 1 1
      src/redis_cache.nim
  5. 2 2
      src/tokens.nim
  6. 3 3
      src/utils.nim
  7. 1 1
      src/views/general.nim

+ 1 - 1
src/apiutils.nim

@@ -5,7 +5,7 @@ import types, tokens, consts, parserutils, http_pool
 
 const rl = "x-rate-limit-"
 
-var pool {.threadvar.}: HttpPool
+var pool: HttpPool
 
 proc genParams*(pars: openarray[(string, string)] = @[]; cursor="";
                 count="20"; ext=true): seq[(string, string)] =

+ 2 - 2
src/http_pool.nim

@@ -5,8 +5,8 @@ type
   HttpPool* = ref object
     conns*: seq[AsyncHttpClient]
 
-var maxConns {.threadvar.}: int
-var proxy {.threadvar.}: Proxy
+var maxConns: int
+var proxy: Proxy
 
 proc setMaxHttpConns*(n: int) =
   maxConns = n

+ 1 - 1
src/prefs.nim

@@ -6,7 +6,7 @@ from parsecfg import nil
 
 export genUpdatePrefs, genResetPrefs
 
-var defaultPrefs* {.threadvar.}: Prefs
+var defaultPrefs*: Prefs
 
 proc updateDefaultPrefs*(cfg: parsecfg.Config) =
   genDefaultPrefs()

+ 1 - 1
src/redis_cache.nim

@@ -9,7 +9,7 @@ const
   baseCacheTime = 60 * 60
 
 var
-  pool {.threadvar.}: RedisPool
+  pool: RedisPool
   rssCacheTime: int
   listCacheTime*: int
 

+ 2 - 2
src/tokens.nim

@@ -11,8 +11,8 @@ const
   failDelay = initDuration(minutes=30)
 
 var
-  clientPool {.threadvar.}: HttpPool
-  tokenPool {.threadvar.}: seq[Token]
+  clientPool: HttpPool
+  tokenPool: seq[Token]
   lastFailed: Time
 
 proc getPoolInfo*: string =

+ 3 - 3
src/utils.nim

@@ -1,14 +1,15 @@
 # SPDX-License-Identifier: AGPL-3.0-only
-import strutils, strformat, sequtils, uri, tables, base64
+import strutils, strformat, uri, tables, base64
 import nimcrypto, regex
 
 var
-  hmacKey {.threadvar.}: string
+  hmacKey: string
   base64Media = false
 
 const
   https* = "https://"
   twimg* = "pbs.twimg.com/"
+  nitterParams = ["name", "tab", "id", "list", "referer", "scroll"]
   twitterDomains = @[
     "twitter.com",
     "pic.twitter.com",
@@ -17,7 +18,6 @@ const
     "pbs.twimg.com",
     "video.twimg.com"
   ]
-  nitterParams = ["name", "tab", "id", "list", "referer", "scroll"]
 
 proc setHmacKey*(key: string) =
   hmacKey = key

+ 1 - 1
src/views/general.nim

@@ -86,7 +86,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; titleText=""; desc=""; video="";
 
     if banner.len > 0:
       let bannerUrl = getPicUrl(banner)
-      link(rel="preload", type="image/png", href=getPicUrl(banner), `as`="image")
+      link(rel="preload", type="image/png", href=bannerUrl, `as`="image")
 
     for url in images:
       let suffix = if "400x400" in url: "" else: "?name=small"