Files
bookorbit/koreader-plugin/bookorbit.koplugin/bookorbit_download_root.lua
T
neon 80244ea4e2 feat(koreader): rebuild the plugin interface and fix four-way annotation sync
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.
2026-10-20 16:05:27 -06:00

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