mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Simplify db code
This commit is contained in:
parent
c7a2387aeb
commit
d7e0fa6059
6 changed files with 21 additions and 15 deletions
|
|
@ -102,7 +102,7 @@ proc getVideoVar(tweet: Tweet): var Option[Video] =
|
|||
return tweet.video
|
||||
|
||||
proc getVideo*(tweet: Tweet; agent, token: string; force=false) {.async.} =
|
||||
withDb:
|
||||
withCustomDb("cache.db", "", "", ""):
|
||||
try:
|
||||
getVideoVar(tweet) = some(Video.getOne("videoId = ?", tweet.id))
|
||||
except KeyError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue