Commit Graph

22 Commits (039947886fbc1de89f0236837015b1d817db99f5)

Author SHA1 Message Date
Frans de Jonge 039947886f
Revert "Hyphenation: add custom hyphenation rules (#7746)" (#7785)
This reverts commit f25da5d0d5.
3 years ago
zwim f25da5d0d5
Hyphenation: add custom hyphenation rules (#7746)
The hyphenation of a word can be changed from its default
by long pressing for 3 seconds and selecting 'Hyphenate'.
These overrides are stored in a per-language file, i.e:
koreader/settings/user-German.hyph.
3 years ago
hius07 d5a2df3c04
OPDS: Add a button to display an entry's content block in the download popup (#7767) 3 years ago
NiLuJe 2635593890 Cache: Some more tweaks after #7624
* Allow doing away with CacheItem
  Now that we have working FFI finalizers on BBs, it's mostly useless overhead.
  We only keep it for DocCache, because it's slightly larger, and memory pressure might put us in a do or die situation where waiting for the GC might mean an OOM kill.
* Expose's LRU slot-only mode
  And use it for CatalogCache, which doesn't care about storage space
* Make GlyphCache slots only (storage space is insignificant here, it was
  always going to be evicted by running out of slots).
* More informative warning when we chop the cache in half
3 years ago
NiLuJe 21b067792d Cache: Rewrite based on lua-lru
Ought to be faster than our naive array-based approach.
Especially for the glyph cache, which has a solid amount of elements,
and is mostly cache hits.
(There are few things worse for performance in Lua than
table.remove @ !tail and table.insert @ !tail, which this was full of :/).

DocCache: New module that's now an actual Cache instance instead of a
weird hack. Replaces "Cache" (the instance) as used across Document &
co.
Only Cache instance with on-disk persistence.

ImageCache: Update to new Cache.

GlyphCache: Update to new Cache.
Also, actually free glyph bbs on eviction.
3 years ago
NiLuJe ce624be8b8 Cache: Fix a whole lot of things.
* Minor updates to the min & max cache sizes (16 & 64MB). Mostly to satisfy my power-of-two OCD.
  * Purge broken on-disk cache files
  * Optimize free RAM computations
  * Start dropping LRU items when running low on memory before pre-rendring (hinting) pages in non-reflowable documents.
  * Make serialize dump the most recently *displayed* page, as the actual MRU item is the most recently *hinted* page, not the current one.
  * Use more accurate item size estimations across the whole codebase.

TileCacheItem:

  * Drop lua-serialize in favor of Persist.

KoptInterface:

  * Drop lua-serialize in favor of Persist.
  * Make KOPTContext caching actually work by ensuring its hash is stable.
3 years ago
NiLuJe 22b9396696
Centralize one time migration code after updates (#7531)
There have been a couple of these this month, and keeping stuff that should only ever run once piling up in their respective module was getting ugly, especially when it's usually simple stuff (settings, files).

So, move everything to a dedicated module, run by reader.lua on startup, and that will actually only do things once, when necessary.
3 years ago
NiLuJe 732ab56104 OPDS: Fix Search when the server's template is a relative path
Fix #7482
3 years ago
hius07 052e19ead5
Standardize search/find to search (#7398)
* Change 'Find a file' to 'File search' for consistency

There is 'File search' in the Gesture manager already.
There is 'Fulltext search' in the readermenu.
Some help text added.
3 years ago
NiLuJe 00eeb4b82b OPDSBrowser: Only update the title on plain navigation
Previously, it was updated with *acquisitions*, too, which was weird.
3 years ago
John Beard 70c79fd27d
Unbreak HTTP authentication (#7425)
Fixes a regression in #7405 that broke Basic auth (OPDS/WebDav).
3 years ago
NiLuJe 2f9db25969
Unify LuaSocket usage (#7405)
* Add a new socketutil module with a few helper functions that allow us to:
  * Always use a sane User-Agent (previously, only Wikipedia did so)
  * Set timeouts in an almost sane manner. Doing it explicitly prevents an interaction with KOSync that does crazy stuff I don't even want to try to understand.
* Unified said timeouts based on the request's intended usage (except for Wikipedia, which already had meaningful timeout values).
* Stopped using LuaSec directly, LuaSocket defers to LuaSec sanely on its own. Everything now transparently supports HTTPS without code duplication.
3 years ago
NiLuJe 48b0f2242c
OPDSBrowser: Unbreak test (#7393) 3 years ago
NiLuJe bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
3 years ago
Alex Vanderpot 7b2eba73ba
Do not include author in OPDS download filename if nil or empty (#7384) 3 years ago
Alex Vanderpot ac26ccdc58
OPDS: Parse Open Search Definition for feeds that support it (#7380) 3 years ago
Frans de Jonge 99db7ff633
Even more directory to folder (#7387)
Cf. https://github.com/koreader/koreader/pull/7386#issuecomment-791555451
3 years ago
Frans de Jonge c0423401aa
A few more directory to folder (#7386)
Cf. https://github.com/koreader/koreader/issues/7350#issuecomment-789672442
3 years ago
NiLuJe 03885071b9
OPDS: Don't needlessly setup Basic auth (#7372)
* OPDS: Don't save an empty username.

That causes LuaSockets to try Basic auth, which is useless (and may or may not be problematic for some servers).

* Attempt to explicitly request non-compressed content.

Some servers may still refuse to obey, though.
They're breaking RFC2616 (a.k.a. HTTP/1.1) by doing so, though, meh.

* Let LuaSocket do its job.

It already handles setting up the Host header, as well as Basic authentication if both username & password are set.
3 years ago
NiLuJe 2e507a42a4
Get rid of OPDS libraries with content of dubious legal status. (#7351)
Remember, it's life +70 in US & EU, life +50 is Canada.
(It's actually slightly more complex than that, and some periods of
time/countries may use a far longer term. IANAL).
3 years ago
Sergey Avseyev 8e1721173e
Add OPDS server from knihi.com (belarusian) (#7263)
https://knihi.com/readers.html
3 years ago
Martín Fernández 5c9e649804
move opds to plugin (#7237) 3 years ago