extra clean up

This commit is contained in:
Volterxien
2025-06-12 22:54:39 -04:00
parent ef787f9ded
commit c1ce89d540
2 changed files with 10 additions and 3 deletions

View File

@@ -125,10 +125,17 @@ function OPDS:getOPDSDownloadMenu()
end
function OPDS:checkSyncDownload(force)
if not G_reader_settings:readSetting("opds_sync_dir") then
self.setSyncDir()
return
end
self:checkServerList(force)
end
function OPDS:checkServerList(force)
for _, item in ipairs(self.servers) do
if item.sync then
local last_download = OPDSBrowser:syncDownload(item, force)
print(last_download)
if last_download then
logger.dbg("Updating opds last download for server " .. item.title)
self:appendFieldToCatalog(item, "last_download", last_download)
@@ -142,7 +149,7 @@ function OPDS:appendFieldToCatalog(item, new_name, new_value)
self.updated = true
end
function OPDS:setSyncDir()
function OPDS.setSyncDir()
local force_chooser_dir
if Device:isAndroid() then
force_chooser_dir = Device.home_dir

View File

@@ -785,7 +785,7 @@ end
-- Returns user selected or last opened folder
function OPDSBrowser.getCurrentDownloadDir(sync)
if sync then
return G_reader_settings:readSetting("opds_sync_dir") or G_reader_settings:readSetting("lastdir")
return G_reader_settings:readSetting("opds_sync_dir")
else
return G_reader_settings:readSetting("download_dir") or G_reader_settings:readSetting("lastdir")
end