mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
When doing "Add files to selected books" do not add the same format multiple times when the user selects multiple files of a particular format
This commit is contained in:
parent
5023426850
commit
e9f1b2f726
@ -132,9 +132,10 @@ class AddAction(InterfaceAction):
|
||||
if not confirm(msg, 'confirm_format_override_on_add', title=_('Are you sure?'), parent=self.gui):
|
||||
return
|
||||
|
||||
fmt_map = {os.path.splitext(fpath)[1][1:].upper():fpath for fpath in books}
|
||||
|
||||
for id_ in ids:
|
||||
for fpath in books:
|
||||
fmt = os.path.splitext(fpath)[1][1:].upper()
|
||||
for fmt, fpath in fmt_map.iteritems():
|
||||
if fmt:
|
||||
db.add_format_with_hooks(id_, fmt, fpath, index_is_id=True,
|
||||
notify=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user