The externalkeyboard plugin was unconditionally disabled on Kindle
because it gates on Kobo-specific OTG sysfs paths (ci_hdrc.0/role,
usbc0/otg_role). However, the keyboard detection and hotplug handling
machinery (findAndSetupKeyboards, onEvdevInputInsert, setupKeyboard)
is already fully generic — it uses fbink_input which works on Kindle.
With the companion koreader-base patch adding a uevent listener to
input-kindle.h, EvdevInputInsert events now fire on Kindle when UHID
devices are created (e.g., by kindle-hid-passthrough). This patch
lets the plugin load on Kindle to handle those events.
Changes:
- Replace the OTG-only gate with a check that allows Kindle through
- Guard OTG role management (init, menu, onExit) behind has_otg_role
so it only runs on platforms with OTG sysfs knobs
- On Kindle init, scan for any keyboards already present
- Hide OTG menu items on Kindle (only show Help)
Kobo behavior is completely unchanged.
Closes: https://github.com/koreader/koreader/issues/14359
Send a metadata object (filename, title, authors) with progress sync
requests when the user opts in via a new 'Send document metadata' toggle
(default off). The metadata is silently ignored by the official sync
server but can be used by custom sync servers.
Closes#13810
Ref: #8764
Creating the cover image delays rotation a little bit (half a second,
even if cached), although it could be several seconds on some PocketBook
devices since #14985 which synchronously invokes `sync` after creating
the cover.
To work around this, skip creating the image in the onSetRotationMode
event hook if "Rotate image" is disabled as the resulting image would be
exactly the same. The speedup is noticeable even if the cover cache gets
hit.
(The issue with synchronous `sync` taking several seconds will be fixed
later once we figure out whether any PocketBook devices actually need
the `sync` or not.)
Related: https://github.com/koreader/koreader/issues/15177
Related: https://github.com/koreader/koreader/pull/14985
Otherwise calibre wil raise an error when its nil:
```
calibre, version 9.4.0
ERROR: Error: Error communicating with device
'uuid'
Traceback (most recent call last):
File "calibre/gui2/device.py", line 110, in run
File "calibre/gui2/device.py", line 581, in _books
File "calibre/devices/smart_device_app/driver.py", line 58, in _synchronizer
File "calibre/devices/smart_device_app/driver.py", line 1316, in books
KeyError: 'uuid'
```
When an OPDS catalog entry's URL resolves to a sub_table with only one
element, sub_table[2] returns nil, causing a crash on the subsequent
item.acquisitions access. Fall back to sub_table[1] when index 2 is nil.
Add a nil check on entry URL in getSyncDownloadList to prevent a
crash when a feed entry has no navigation link. Add a test for
single-quoted attribute feeds.
User can enable key-only access to enhance security,
useful when using public WiFi networks, and just a good rule
even for well-known or home networks.
The unescaped `.` in `".00"` matches any character followed by two
zeros. For a series entry like `"00001.00 | Title - Author"`, the
pattern matches `000` at position 1 instead of the intended literal
`.00` at position 6, producing `"01.00 | Title - Author"`.
Escape as `"%.00"` to match a literal period.
Fix two bugs in the coverimage plugin:
1. cleanCache(): Fix operator precedence in while loop condition. In Lua,
`and` has higher precedence than `or`, so the bounds check `index <= #files`
was only applied to the cache size condition, not the file count condition.
Added parentheses to ensure the bounds check applies to both conditions.
2. getCacheFiles(): Use the function parameters `cache_path` and `cache_prefix`
consistently instead of mixing them with `self.cover_image_cache_path` and
`self.cover_image_cache_prefix`.
`self.re` isn't assigned until later in connect() (line 292), so at line
244 it is always nil — either never set, or cleared by a previous
disconnect(). This caused willRerunWhenConnected to receive nil as its
callback, so after Wi-Fi was brought up the coroutine was never resumed
and the Calibre connection silently died.
Use the local `re` (defined on line 234) which is the correct resume
callback for this coroutine.
* refactor onStopHighlightIndicator so it returns early
* stop text selection when opening menus or triggering hotkeys
* use self.ui.highlight (naturally)
* remove duplicated setDirty
Center the scaled cover image on both axes unconditionally instead
of branching on which dimension is the limiting factor. The branch
was susceptible to floating point rounding in math.floor causing
scaled_w to be 1 pixel less than s_w, flipping the alignment from
vertically centered to top-aligned depending on the cover's pixel
dimensions.
Fixes#14986.
* CoverImage: call iv2sh to update PocketBook startup logo on cover change
After the cover image file is written or reset, invoke PocketBook's
iv2sh WriteStartupLogo command so the device's boot logo is actually
updated. The command runs in the background to avoid blocking KOReader.
* CoverImage: use correct screen dimensions on PocketBook for boot logo
For PocketBook devices, Screen:getWidth/getHeight returns
dimensions that iv2sh will not accept. In that case, we should call
Screen:getScreenWidth and Screen:getScreenHeight instead so the
generated boot logo has the correct size.