diff --git a/frontend/ui/data/onetime_migration.lua b/frontend/ui/data/onetime_migration.lua index 3d129ff08..5664c3ca4 100644 --- a/frontend/ui/data/onetime_migration.lua +++ b/frontend/ui/data/onetime_migration.lua @@ -7,7 +7,7 @@ local lfs = require("libs/libkoreader-lfs") local logger = require("logger") -- Date at which the last migration snippet was added -local CURRENT_MIGRATION_DATE = 20220625 +local CURRENT_MIGRATION_DATE = 20220819 -- Retrieve the date of the previous migration, if any local last_migration_date = G_reader_settings:readSetting("last_migration_date", 0) @@ -417,5 +417,23 @@ if last_migration_date < 20220625 then end end +-- OPDS, same as above +if last_migration_date < 20220819 then + logger.info("Performing one-time migration for 20220819") + + local opds_servers = G_reader_settings:readSetting("opds_servers") + if opds_servers then + -- Update deprecated URLs + for i = #opds_servers, 1, -1 do + local server = opds_servers[i] + + if server.url == "https://standardebooks.org/opds" then + server.url = "https://standardebooks.org/feeds/opds" + end + end + G_reader_settings:saveSetting("opds_servers", opds_servers) + end +end + -- We're done, store the current migration date G_reader_settings:saveSetting("last_migration_date", CURRENT_MIGRATION_DATE) diff --git a/plugins/opds.koplugin/opdsbrowser.lua b/plugins/opds.koplugin/opdsbrowser.lua index b961204db..4e7725c71 100644 --- a/plugins/opds.koplugin/opdsbrowser.lua +++ b/plugins/opds.koplugin/opdsbrowser.lua @@ -40,7 +40,7 @@ local OPDSBrowser = Menu:extend{ }, { title = "Standard Ebooks", - url = "https://standardebooks.org/opds", + url = "https://standardebooks.org/feeds/opds", }, { title = "Feedbooks",