Silence some warnings

This commit is contained in:
Zed 2020-06-22 03:50:16 +02:00
parent 155909aa9f
commit bde3c3662d
9 changed files with 11 additions and 12 deletions

View File

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

View File

@ -62,7 +62,6 @@ proc genQueryParam*(query: Query): string =
if "nativeretweets" notin query.excludes:
param &= "include:nativeretweets "
let rewrite = query.fromUser.len > 0 and query.kind in {posts, media}
for f in query.filters:
filters.add "filter:" & f
for e in query.excludes:

View File

@ -6,7 +6,7 @@ import types, api
const redisNil = "\0\0"
var
pool: RedisPool
pool {.threadvar.}: RedisPool
baseCacheTime = 60 * 60
rssCacheTime: int
listCacheTime*: int

View File

@ -103,7 +103,7 @@ proc createRssRouter*(cfg: Config) =
var key = @"name" & "/" & @"tab"
if @"tab" == "search":
key &= hash(genQueryUrl(query))
key &= $hash(genQueryUrl(query))
key &= getCursor()
var rss = await getCachedRss(key)

View File

@ -1,7 +1,7 @@
import asyncdispatch, httpclient, times, sequtils, strutils
import types
var tokenPool: seq[Token]
var tokenPool {.threadvar.}: seq[Token]
proc fetchToken(): Future[Token] {.async.} =
let

View File

@ -2,7 +2,7 @@ import strutils, strformat, sequtils, uri, tables, base64
import nimcrypto, regex
var
hmacKey = "secretkey"
hmacKey {.threadvar.}: string
base64Media = false
const
@ -51,7 +51,7 @@ proc cleanFilename*(filename: string): string =
result &= ".png"
proc filterParams*(params: Table): seq[(string, string)] =
let filter = ["name", "id", "list", "referer", "scroll"]
const filter = ["name", "id", "list", "referer", "scroll"]
toSeq(params.pairs()).filterIt(it[0] notin filter and it[1].len > 0)
proc isTwitterUrl*(uri: Uri): bool =

View File

@ -1,5 +1,5 @@
import tables, macros, strutils, os
import karax/[karaxdsl, vdom, vstyles]
import tables, macros, strutils
import karax/[karaxdsl, vdom]
import renderutils
import ../types, ../prefs_impl

View File

@ -4,7 +4,7 @@ import karax/[karaxdsl, vdom]
import renderutils, timeline
import ".."/[types, query]
let toggles = {
const toggles = {
"nativeretweets": "Retweets",
"media": "Media",
"videos": "Videos",

View File

@ -1,5 +1,5 @@
import strutils, strformat, sequtils, algorithm, times, uri, options
import karax/[karaxdsl, vdom, vstyles]
import strutils, strformat, sequtils, algorithm, uri, options
import karax/[karaxdsl, vdom]
import ".."/[types, query, formatters]
import tweet, renderutils