-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
improvements for device.py: #2315
Conversation
- multiple author match support - debug print - NO_AUTHOR_MATCH tag for Author mismatch - '&' > 'and' support in book title
043d279
to
d0e78e0
Compare
Ahhh, I see why I couldn't replicate your problem. You are dealing with books sideloaded on the Kobo some way other than by calibre. This means the UUID is wrong/non-existent and the book metadata might have nothing to do with the metadata in calibre. The "Match book in library" option in the device view context menu exists for these cases. @kovid: I am nervous about the change to clean_string changing '&' to 'and'. It isn't clear how this change will affect matching on non-Kobo devices. I am also a bit nervous about using "NO_AUTHOR_MATCH" value to indicate that the book didn't match. A book having a value in that column means the book did match, specifying how the book matched. Finally, it isn't clear how this might affect "Match book in library" and "Show matched book in library" in the device view context menu. |
Replacing & with and is definitely not correct. device.py cannot have device specific fixes. If you want to make such a fix, the place to do it is the kobo driver. And I agree NO_AUTHOR_MATCH is not appropriate. Matching if only one author matches but all authors dont match is probably OK. Finally, if you want a debug_print() function use the existing one from usbms/driver.py |
The standard kobo driver doesn't use metadata.calibre for anything. It builds the booklist from the db. New books must be scanned which happens after a disconnect. Existing books aren't rescanned; they must be deleted before being resent. The match books function is in the context menu for the device view. |
The debug_print() function at line 26 of usbms/driver.py |
my bad, was looking in wrong place, updated |
also is there documentation of use of |
As I said before, the wireless driver doesn't use any form of metadata.calibre. The remote device supplies the metadata. As for documentation, metadata.calibre is built from the book list supplied by the device driver. Various drivers build the booklist in different ways. It is the driver-built booklist that device.py users. |
On Sun, Jun 23, 2024 at 08:01:47AM -0700, kyxap wrote:
also is there documentation of use of `metadata.calibre` and `.metadata.calibre` (wireless metadata) ?
No, these are calibre internal files, not to be used by anything other
than calibre.
|
The device view context menu is defined here: calibre/src/calibre/gui2/__init__.py Line 374 in da19745
The device view context menu is set up here: calibre/src/calibre/gui2/init.py Line 100 in da19745
The plugin used in the above context men for the 'Match Books' action is here: https://github.com/kovidgoyal/calibre/blob/master/src/calibre/gui2/actions/match_books.py It uses this dialog to do the work: https://github.com/kovidgoyal/calibre/blob/master/src/calibre/gui2/dialogs/match_books.py Note that you must choose 'Update cached metadata on device' in the device view toolbar to cause the changes to be given to the actual device driver. The usual method is calling "sync_booklists()" in the driver, which stores the changes however it does. This call is done by a signal that (eventually) calls this method in device.py: calibre/src/calibre/gui2/device.py Line 1765 in da19745
|
Before:
After:
Note: Author
C
- withNO_AUTHOR_MATCH
when Author changed in calibre after book was pushed to the deviceAlso tried to report this as a bug but failed :| https://bugs.launchpad.net/calibre/+bug/2070045
Windows 11
Kobo Clara BW