mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Update Standard Ebooks OPDS URLs to new URL (#9371)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -40,7 +40,7 @@ local OPDSBrowser = Menu:extend{
|
||||
},
|
||||
{
|
||||
title = "Standard Ebooks",
|
||||
url = "https://standardebooks.org/opds",
|
||||
url = "https://standardebooks.org/feeds/opds",
|
||||
},
|
||||
{
|
||||
title = "Feedbooks",
|
||||
|
||||
Reference in New Issue
Block a user