Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send metadata to the device is performed after each ebook is transfered to Kindle #277

Open
3 tasks done
bbeny123 opened this issue Nov 27, 2024 · 1 comment
Open
3 tasks done

Comments

@bbeny123
Copy link

Checkboxes

  • I have read the installation and usage documents.
  • I have not found similar open/closed issue or disscussion.
  • Reboot doesn't fix the problem.

Describe the bug and copy the error message

Calibre 7.21 x64 / Windows 11

Currently, when transferring multiple books to a Kindle using the WordDumb plugin, the "Send metadata to the device" operation is executed after each book is transferred. For example, for 1000 books, "Send metadata to the device" will be performed 1000 times.

While this is not an issue for small libraries, it significantly slows down the sending process for large libraries, especially since the metadata.calibre file can exceed 100 MBs for such collections.

To address this problem, I suggest introducing the option to execute "Send metadata to the device" only once, after all other tasks in the queue have been completed.

For older Kindles it was possible to workaround the issue by setting the metadata.calibre as read-only. Unfortunately, this is no longer possible for 2024 models (as they are detected as MTP devices).

I have already reported this issue to Calibre (https://bugs.launchpad.net/calibre/+bug/2089718), but it turns out that this is a bug with WordDumb.

Plugin settings and reproduce steps

  1. Select multiple ebooks
  2. Run the WordDumb plugin
  3. In the task log, you can observe that "Send metadata to the device" is executed after each book is sent individually

Generated files, screenshots or videos

No response

@xxyzz
Copy link
Owner

xxyzz commented Nov 27, 2024

I don't even know how the "send metadata to device" job is created. Maybe I use calibre's api in a wrong way? I don't know. And I'm really don't want to change the update code, get this code working is not easy.

I suggest you only send one book, read it then send another.

Relevant code at here:

WordDumb/send_file.py

Lines 95 to 103 in e341f48

job = self.device_manager.upload_books(
FunctionDispatcher(self.send_files),
[self.job_data.book_path],
[Path(self.job_data.book_path).name],
on_card=None,
metadata=[self.job_data.mi],
titles=[i.title for i in [self.job_data.mi]],
plugboards=self.gui.current_db.new_api.pref("plugboards", {}),
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants