Support title and description for videos

This commit is contained in:
Zed
2019-10-26 15:50:42 +02:00
parent 02b206078d
commit 371a2473bc
6 changed files with 26 additions and 5 deletions

View File

@@ -3,6 +3,10 @@ import norm/sqlite
import types, api/profile
template safeAddColumn(field: typedesc): untyped =
try: field.addColumn
except DbError: discard
dbFromTypes("cache.db", "", "", "", [Profile, Video])
withDb:
@@ -10,6 +14,8 @@ withDb:
createTables()
except DbError:
discard
Video.title.safeAddColumn
Video.description.safeAddColumn
var profileCacheTime = initDuration(minutes=10)