Filter and sort tags after replacing.

This commit is contained in:
Arun Prakash Jana 2016-06-07 21:26:22 +05:30
parent 6c26f3c26c
commit 550469b15f
No known key found for this signature in database
GPG Key ID: C0A712ED95043DCB

3
buku
View File

@ -742,7 +742,7 @@ class BukuDb:
def replace_tag(self, orig, new=None): def replace_tag(self, orig, new=None):
"""Replace orig tags with new tags in DB for all records. """Replace orig tags with new tags in DB for all records.
Remove orig tag is new tag is empty. Remove orig tag if new tag is empty.
Params: original and new tags Params: original and new tags
""" """
@ -773,6 +773,7 @@ class BukuDb:
newtags = DELIMITER newtags = DELIMITER
tags = row[1].replace(orig, newtags) tags = row[1].replace(orig, newtags)
tags = parse_tags([tags])
self.cur.execute('UPDATE bookmarks SET tags = ? WHERE id = ?', (tags, row[0],)) self.cur.execute('UPDATE bookmarks SET tags = ? WHERE id = ?', (tags, row[0],))
print('Index %d updated' % row[0]) print('Index %d updated' % row[0])
update = True update = True