cli: dump metadata only of the added books

This commit is contained in:
un-pogaz 2026-05-12 13:09:48 +02:00
parent c1290a5c88
commit f36fb3cdf3

View File

@ -27,7 +27,7 @@ def empty(db, notify_changes, is_remote, args):
ids, duplicates = db.add_books([(mi, {})])
if is_remote:
notify_changes(books_added(ids))
db.dump_metadata()
db.dump_metadata(book_ids=ids)
return ids, bool(duplicates)
@ -104,7 +104,7 @@ def do_adding(db, request_id, notify_changes, is_remote, mi, format_map, add_dup
notify_changes(books_added(added_ids))
if updated_ids:
notify_changes(formats_added({book_id: tuple(format_map) for book_id in updated_ids}))
db.dump_metadata()
db.dump_metadata(book_ids=added_ids | updated_ids)
return added_ids, updated_ids, duplicates