Commit Graph

42 Commits (859327dea58cfa2b3c634b5ae4ecc1008b8c6f23)

Author SHA1 Message Date
hius07 859327dea5
Input dialogs: keep size in rotation (#8223) 3 years ago
yparitcher f5dc7b4539 Dispatcher: Revamp sections and item order 3 years ago
Frans de Jonge 341d6ac660
[plugin] Wallabag: different timeouts for API calls vs file downloads (#7668)
Fixes <https://github.com/koreader/koreader/issues/7650>.
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
Frans de Jonge 1ef6d0b257
[feat] Support mimetypes in DocumentRegistry:hasProvider() (#7155)
And make .djvu the canonical extension for DjVu.

Fixes #5478.
3 years ago
yparitcher 433b82f162 Dispatcher: allow registering actions at runtime 4 years ago
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
4 years ago
Frans de Jonge 4c524de472
Fix typo (#6425)
Reported by https://hosted.weblate.org/user/leschek/ on Weblate
4 years ago
Frans de Jonge ac1fa5d677
[plugin] Wallabag: Make remove from history consistent with deletion (#6320)
Finished is a specific status distinct from 100% read.

Also reorganize the menus slightly.

Closes <#6316>.
4 years ago
Frans de Jonge 8ea7a1354a
[chore, plugin] Simplify Wallabag http.request handling (#6307)
See <https://github.com/koreader/koreader-base/issues/594#issuecomment-484233915>.

LuaSocket takes care of everything now, so all similar code can be simplified.
4 years ago
NiLuJe 1f994f8ede
Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
4 years ago
Frans de Jonge 19b15462b2
[plugin, UX] Wallabag: aid with setting up missing information (#6262)
The MultiConfirmBox indicates which settings are still missing and offers you a quick way to get to them.

Cf. <https://github.com/koreader/koreader/issues/6129>.
4 years ago
Frans de Jonge 04a5e2acfa
[fix, plugin] Wallabag: add quiet option to callAPI() (#6252)
Dumb lazy workaround for <https://github.com/koreader/koreader/issues/6251>.
4 years ago
mwoz123 395e65f749
Add Wallabag queue (#6170)
See https://github.com/koreader/koreader/issues/6119#issuecomment-624329183
4 years ago
mwoz123 0e2b430796
Fix/exit dir (#6163) 4 years ago
poire-z 46221985a6
Delegate "lastfile" management to ReadHistory (#6128)
Simplify (and avoid edge cases) in other code by having
ReadHistory manage the "lastfile" setting on add, remove,
rename...
Fixed a few other cases of things not updated.
4 years ago
mwoz123 8b4f1ca42e
Wallabag remove from history setting fixes (#6059) 4 years ago
mwoz123 0b52fe9771
Wallabag remove from history setting (#6048)
Solves: #5045
4 years ago
poire-z 0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
4 years ago
teroshan ebcefe1c98 [feat] plugins/Wallabag: add ability to set a list of tags to ignore (#5467)
A new setting has been adding allowing to set a comma separated list of
tags to ignore.

Entries with either of these tags will be skipped by the client when
fetching the list of articles to download. Extra articles will be
fetched from the server to make up for the skipped articles, ensuring to
meet the target number of articles.
5 years ago
teroshan 63e80c7bb7 [wallabag] comply with coding conventions 5 years ago
teroshan 26437758e5 [wallabag] fetch pdf files directly instead of converting them
Currently, all the articles were converted to .epub by default. When
handling an article that linked to a .pdf file, it resulted in an
unreadable file.

This patch skips the conversion for a pdf file, and download it directly
instead.
5 years ago
Frans de Jonge a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
5 years ago
Frans de Jonge da988c15de
[CI] Switch to custom xgettext build to extract multiline strings (#5242)
Because let's face it, it just looks much better this way.

Docker image update in https://github.com/koreader/virdevenv/pull/43

Discussion in https://github.com/koreader/koreader/pull/5238#issuecomment-523675211 and https://github.com/koreader/koreader/pull/4524
5 years ago
Frans de Jonge e2ceace302
[fix, CI] Push to Transifex from master, fix multiline strings for xgettext (#5238)
Related to https://github.com/koreader/koreader/pull/5237
5 years ago
Le Tuan 6cf9b4c89d [feat] plugins/Wallabag: archiving instead of deleting articles (#5148)
Marks finished articles as read (archived) instead of permanently deleting them.
5 years ago
Le Tuan 14bdf4782a [feat] Wallabag: customizable articles count per sync (#5147)
Includes:
- New client settings menu and dialog.
- Articles count to fetch per sync is customizable.
5 years ago
Frans de Jonge 9300a59a89
[fix] util.getSafeFilename() maximum extension length (#5067)
Strip HTML and do some semi-intelligent detection of faux extensions (i.e., more than 10 characters probably isn't one).

Fixes #5049.
5 years ago
Frans de Jonge e261d95218
[fix, plugins] Wallabag: close document on go to folder (#5063)
See https://github.com/koreader/koreader/issues/5060#issuecomment-499416617
5 years ago
Frans de Jonge 439f876ad8
[fix] util.getSafeFilename() default to worst-case scenario (#5036)
Also pass path from Wallabag plugin.

Fixes #5025.
5 years ago
Frans de Jonge 8815cbe07a
[fix, chore] Abstract filename logic in util.getSafeFilename() (#5026)
Fixes https://github.com/koreader/koreader/issues/5025

The OPDS browser was doing some fancier stuff in a way that should be abstracted away in util (because it applies anywhere files will be saved):

eace8d25c1/frontend/ui/widget/opdsbrowser.lua (L482-L491)
5 years ago
Frans de Jonge 709207a621
[feat, UX] Add external link to Wallabag (#4863)
Offers a choice when Wallabag is available.
5 years ago
Frans de Jonge 76fd9228d3
[feat] plugins/wallabag: addArticle() method (#4852)
Currently unused, but a prerequisite for dynamically adding links to Wallabag.
5 years ago
Frans de Jonge 090a0f8035 [feat] plugins/wallabag: Allow calling Wallabag retrieval with event 5 years ago
poire-z 335a513826 [chore] cleanup multi-lines translatable strings
Revert 9971eb85 and make multi-lines strings more readable.
(Multiline translatable strings extraction has been fixed
in koreader-misc tralua_xgettext.py.)
5 years ago
Brian Winkler b6298810bb Fixed Wallabag plugin's parsing of wrong API url. (#4501)
The Wallabag plugin's callAPI() method was attempting to parse the user supplied
URL for the Wallabag API. Unfortunately, the parse was silently failing since
the variable apiurl did not contain a complete URL. The scheme of the parsed
URL (always nil) was then used to select either http or https (default). The
result being https was always selected, regardless of the user supplied setting.

The parsed URL was switched to the variable server_url instead of apiurl but the
behavior resulting in the default selection of https when parsing fails was left
unchanged.
5 years ago
James Brechtel 3bf4db9960 [fix] Wallabag - Use JSON.encode to encode auth JSON (#4449)
Previously the plugin was creating JSON by hand for authentication requests.
This would cause invalid JSON to be sent when the password contained characters
that need to be escaped (e.g. "). Using JSON.encode will result in values being
properly escaped when necessary.
5 years ago
Frans de Jonge 8932a5e765
[fix, i18n] plugins/wallabag: make a few overlooked strings translateable (#4408)
Notified on the forum https://www.mobileread.com/forums/showthread.php?p=3787617#post3787617
5 years ago
Yann Muller 3f7f5f07bf Wallabag fixes and improvements (#4347)
* Improved error handling.

* Removed unused variable.

* [fix] Skip remote deletes if disabled.

* Addded Wallabag preffix to logger output.
6 years ago
Yann Muller 653741dfac [fix] Wallabag: fix for un-configured plugin error (#4277) 6 years ago
Frans de Jonge 588de66bcd
[lang] Plugins: Wallabag fix typo (#4273) 6 years ago
Yann Muller 846f8bfa18 Wallabag plugin (#4271)
A plugin to download articles from a Wallabag server, an
open source read-it-later service (https://wallabag.org).
6 years ago