unified calibre plugin (#6177)

joins calibre metadata search and calibre wireless connections into a single plugin

search metadata changes:

- search directly into calibre metadata files.
- search can be performed on more than one library (configurable from a menu)
- device scans now find all calibre libraries under a given root
- search options can be configured from a menu. (case sensitive, find by title, author and path)
- removed legacy global variables.
- *option* to search from the reader
- *option* to generate a cache of books for faster searches.

calibre wireless connection changes:

- keep track of books in a library (includes prunning books from calibre metadata if the file was deleted locally)
- remove files on device from calibre
- support password protected connections
- FM integration: if we're in the inbox dir it will be updated each time a book is added or deleted.
- disconnect when requested by calibre, available on newer calibre versions (+4.17)
- remove unused opcodes.
- better report of client name, version and device id
- free disk space checks for all calibre versions
- bump supported extensions to match what KOReader can handle. Users can override this with their own list of extensions (or from calibre, by configuring the wireless device).
This commit is contained in:
Martín Fernández
2020-06-19 12:22:38 +02:00
committed by GitHub
parent 2e731dd4dd
commit 83cde64bcc
19 changed files with 2000 additions and 1240 deletions

View File

@@ -108,6 +108,9 @@ local action_strings = {
wallabag_download = _("Wallabag retrieval"),
kosync_push_progress = _("Push progress from this device"),
kosync_pull_progress = _("Pull progress from other devices"),
calibre_search = _("Search in calibre metadata"),
calibre_browse_tags = _("Browse all calibre tags"),
calibre_browse_series = _("Browse all calibre series"),
}
local custom_multiswipes_path = DataStorage:getSettingsDir().."/multiswipes.lua"
@@ -792,6 +795,10 @@ function ReaderGesture:buildMenu(ges, default)
{"kosync_push_progress", not self.is_docless},
{"kosync_pull_progress", not self.is_docless},
{"calibre_search", true},
{"calibre_browse_tags", true},
{"calibre_browse_series", true},
}
local return_menu = {}
-- add default action to the top of the submenu
@@ -1580,6 +1587,12 @@ function ReaderGesture:gestureAction(action, ges)
self.ui:handleEvent(Event:new("KOSyncPushProgress"))
elseif action == "kosync_pull_progress" then
self.ui:handleEvent(Event:new("KOSyncPullProgress"))
elseif action == "calibre_search" then
self.ui:handleEvent(Event:new("CalibreSearch"))
elseif action == "calibre_browse_tags" then
self.ui:handleEvent(Event:new("CalibreBrowseTags"))
elseif action == "calibre_browse_series" then
self.ui:handleEvent(Event:new("CalibreBrowseSeries"))
end
return true
end