Fix #2121 (Remove before Add when editing tags in bulk)

This commit is contained in:
Kovid Goyal 2009-03-21 12:26:46 -07:00
parent 3c5d1b69c5
commit aacd082e54

View File

@ -70,14 +70,14 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
pub = qstring_to_unicode(self.publisher.text()) pub = qstring_to_unicode(self.publisher.text())
if pub: if pub:
self.db.set_publisher(id, pub, notify=False) self.db.set_publisher(id, pub, notify=False)
tags = qstring_to_unicode(self.tags.text()).strip()
if tags:
tags = map(lambda x: x.strip(), tags.split(','))
self.db.set_tags(id, tags, append=True, notify=False)
remove_tags = qstring_to_unicode(self.remove_tags.text()).strip() remove_tags = qstring_to_unicode(self.remove_tags.text()).strip()
if remove_tags: if remove_tags:
remove_tags = [i.strip() for i in remove_tags.split(',')] remove_tags = [i.strip() for i in remove_tags.split(',')]
self.db.unapply_tags(id, remove_tags, notify=False) self.db.unapply_tags(id, remove_tags, notify=False)
tags = qstring_to_unicode(self.tags.text()).strip()
if tags:
tags = map(lambda x: x.strip(), tags.split(','))
self.db.set_tags(id, tags, append=True, notify=False)
if self.write_series: if self.write_series:
self.db.set_series(id, qstring_to_unicode(self.series.currentText()), notify=False) self.db.set_series(id, qstring_to_unicode(self.series.currentText()), notify=False)