Skip to content

Commit 4ffbf83

Browse files
committed
Fix adding highlight on Note import
1 parent eba5909 commit 4ffbf83

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

JWLManager.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2012,14 +2012,13 @@ def add_usermark(attribs, location_id):
20122012
con.execute(f"INSERT INTO UserMark (UserMarkId, ColorIndex, LocationId, StyleIndex, UserMarkGuid, Version) VALUES (?, ?, 0, '{unique_id}', 1);", (usermark_id, attribs['COLOR'], location_id))
20132013
else:
20142014
usermark_id = con.execute(f"INSERT INTO UserMark (ColorIndex, LocationId, StyleIndex, UserMarkGuid, Version) VALUES (?, ?, 0, '{unique_id}', 1);", (attribs['COLOR'], location_id)).lastrowid
2015-
# usermark_id = con.execute(f"SELECT UserMarkId FROM UserMark WHERE UserMarkGuid = '{unique_id}';").fetchone()[0]
20162015
if not ns:
20172016
return usermark_id
20182017
existing_id = con.execute(f"SELECT BlockRangeId FROM BlockRange WHERE BlockType = ? AND Identifier = ? AND StartToken = ? AND EndToken = ? AND UserMarkId = ?;", (block_type, identifier, ns, ne, usermark_id)).fetchone()
20192018
if not existing_id:
20202019
if available_ids.get('BlockRange'):
20212020
blockrange_id = available_ids['BlockRange'].pop()
2022-
con.execute('INSERT INTO BlockRange (BlockRangeId, BlockType, Identifier, StartToken, EndToken, UserMarkId) VALUES (?, ?, ?, ?, ?);', (blockrange_id, block_type, identifier, ns, ne, usermark_id))
2021+
con.execute('INSERT INTO BlockRange (BlockRangeId, BlockType, Identifier, StartToken, EndToken, UserMarkId) VALUES (?, ?, ?, ?, ?, ?);', (blockrange_id, block_type, identifier, ns, ne, usermark_id))
20232022
else:
20242023
con.execute('INSERT INTO BlockRange (BlockType, Identifier, StartToken, EndToken, UserMarkId) VALUES (?, ?, ?, ?, ?);', (block_type, identifier, ns, ne, usermark_id))
20252024
return usermark_id

0 commit comments

Comments
 (0)