Add op column to database
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -33,7 +33,8 @@ def get_db(db_path: str = DB_PATH):
|
||||
filename text,
|
||||
tim varchar(30),
|
||||
thumb_path text,
|
||||
reason varchar(200)
|
||||
reason varchar(200),
|
||||
op boolean default 0
|
||||
);
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -76,6 +76,7 @@ async def pull():
|
||||
if key != "time"
|
||||
}
|
||||
post = defaultdict(lambda: None, posts[cols["post"]["data-pid"]])
|
||||
post["op"] = "(OP)" in str(cols["post"])
|
||||
|
||||
if "thumb" in post:
|
||||
thumb = post['thumb']
|
||||
@@ -170,7 +171,7 @@ async def pull():
|
||||
|
||||
db.execute(
|
||||
"""
|
||||
insert into bans (action, board, length, now, name, trip, com, time, sub, nsfw, thumb, ext, w, h, tn_w, tn_h, md5, fsize, filename, tim, thumb_path, reason)
|
||||
insert into bans (action, board, length, now, name, trip, com, time, sub, nsfw, thumb, ext, w, h, tn_w, tn_h, md5, fsize, filename, tim, thumb_path, reason, op)
|
||||
values (
|
||||
:action,
|
||||
:board,
|
||||
@@ -193,7 +194,8 @@ async def pull():
|
||||
:filename,
|
||||
:tim,
|
||||
:thumb_path,
|
||||
:reason
|
||||
:reason,
|
||||
:op
|
||||
)
|
||||
""",
|
||||
post,
|
||||
|
||||
Reference in New Issue
Block a user