mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix calibredb backup_metadata --all operating only on dirty books not all books. Fixes #1987390 [calibredb backup_metadata problem](https://bugs.launchpad.net/calibre/+bug/1987390)
This commit is contained in:
parent
4dbdea4122
commit
4b1ab3e036
@ -52,16 +52,21 @@ class BackupProgress:
|
||||
self.total = book_id
|
||||
else:
|
||||
self.count += 1
|
||||
if ok:
|
||||
prints(
|
||||
'{:.1f}% {} - {}'.format((self.count * 100) / float(self.total), book_id,
|
||||
getattr(mi, 'title', 'Unknown'))
|
||||
)
|
||||
else:
|
||||
prints(
|
||||
'{:.1f}% {} failed'.format((self.count * 100) / float(self.total), book_id))
|
||||
|
||||
|
||||
def main(opts, args, dbctx):
|
||||
db = dbctx.db
|
||||
book_ids = None
|
||||
if opts.all:
|
||||
book_ids = db.all_ids()
|
||||
book_ids = db.new_api.all_book_ids()
|
||||
db.new_api.mark_as_dirty(book_ids)
|
||||
db.dump_metadata(book_ids=book_ids, callback=BackupProgress())
|
||||
return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user