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,
|
filename text,
|
||||||
tim varchar(30),
|
tim varchar(30),
|
||||||
thumb_path text,
|
thumb_path text,
|
||||||
reason varchar(200)
|
reason varchar(200),
|
||||||
|
op boolean default 0
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ async def pull():
|
|||||||
if key != "time"
|
if key != "time"
|
||||||
}
|
}
|
||||||
post = defaultdict(lambda: None, posts[cols["post"]["data-pid"]])
|
post = defaultdict(lambda: None, posts[cols["post"]["data-pid"]])
|
||||||
|
post["op"] = "(OP)" in str(cols["post"])
|
||||||
|
|
||||||
if "thumb" in post:
|
if "thumb" in post:
|
||||||
thumb = post['thumb']
|
thumb = post['thumb']
|
||||||
@@ -170,7 +171,7 @@ async def pull():
|
|||||||
|
|
||||||
db.execute(
|
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 (
|
values (
|
||||||
:action,
|
:action,
|
||||||
:board,
|
:board,
|
||||||
@@ -193,7 +194,8 @@ async def pull():
|
|||||||
:filename,
|
:filename,
|
||||||
:tim,
|
:tim,
|
||||||
:thumb_path,
|
:thumb_path,
|
||||||
:reason
|
:reason,
|
||||||
|
:op
|
||||||
)
|
)
|
||||||
""",
|
""",
|
||||||
post,
|
post,
|
||||||
|
|||||||
Reference in New Issue
Block a user