mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 08:21:39 -06:00
80244ea4e2
Squash of feat/koreader-widget-board. KOReader plugin 2.0.0 gets the widget-board dashboard, redesigned book details, menus, lists and dialogs, Decor page and reading companions. Highlights, notes and bookmarks now stay in step across web, Kobo, KOReader and the phones (defects D-00 to D-20, migration 0121), and reading progress and narration hand off cleanly between devices.
21 lines
744 B
Lua
21 lines
744 B
Lua
--[[--
|
|
The folder catalog downloads land under.
|
|
|
|
Downloads keep the server's folder layout below this root. KOReader's own last
|
|
resort, the folder last browsed, moves with every visit, so a book fetched again
|
|
from inside one of those folders landed in a second copy of the layout. The
|
|
Home folder stays put, so it comes before it.
|
|
]]
|
|
|
|
local DownloadRoot = {}
|
|
|
|
function DownloadRoot.get()
|
|
local root = G_reader_settings:readSetting("download_dir") or G_reader_settings:readSetting("home_dir")
|
|
if root then return root end
|
|
local ok, Device = pcall(require, "device")
|
|
if ok and type(Device) == "table" and Device.home_dir then return Device.home_dir end
|
|
return G_reader_settings:readSetting("lastdir")
|
|
end
|
|
|
|
return DownloadRoot
|