prevent dupe tags from mtp (replace id3 tags)

This commit is contained in:
ed 2021-03-20 01:00:57 +01:00
parent 90c5f2b9d2
commit a83d3f8801
2 changed files with 21 additions and 0 deletions

View file

@ -700,6 +700,16 @@ class Up2k(object):
# indicate scanned without tags
tags = {"x": 0}
if not tags:
return 0
for k in tags.keys():
q = "delete from mt where w = ? and ({})".format(
" or ".join(["k = ?"] * len(tags))
)
args = [wark[:16]] + list(tags.keys())
write_cur.execute(q, tuple(args))
ret = 0
for k, v in tags.items():
q = "insert into mt values (?,?,?)"