Compatibility fix for older sqlite version + improvements #18

Merged
osilkin98 merged 5 commits from hidden_db_fix into master 2019-10-16 23:09:40 +02:00
Showing only changes of commit 905e394c5f - Show all commits

View file

@ -119,10 +119,19 @@ def insert_comment(conn: sqlite3.Connection, claim_id: str, comment: str, parent
conn.execute( conn.execute(
""" """
INSERT INTO COMMENT(CommentId, LbryClaimId, ChannelId, Body, ParentId, INSERT INTO COMMENT(CommentId, LbryClaimId, ChannelId, Body, ParentId,
Timestamp, Signature, SigningTs) Timestamp, Signature, SigningTs, IsHidden)
VALUES (?, ?, ?, ?, ?, ?, ?, ?) VALUES (:comment_id, :claim_id, :channel_id, :comment, :parent_id,
""", :timestamp, :signature, :signing_ts, 0) """,
(comment_id, claim_id, channel_id, comment, parent_id, timestamp, signature, signing_ts) {
'comment_id': comment_id,
'claim_id': claim_id,
'channel_id': channel_id,
'comment': comment,
'parent_id': parent_id,
'timestamp': timestamp,
'signature': signature,
'signing_ts': signing_ts
}
) )
logging.info('Inserted Comment into DB, `comment_id`: %s', comment_id) logging.info('Inserted Comment into DB, `comment_id`: %s', comment_id)
return comment_id return comment_id