Update Standard Ebooks OPDS URLs to new URL (#9371)

reviewable/pr9448/r1
Alex Cabal 2 years ago committed by GitHub
parent e7ec729adb
commit 39b0ca2f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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",

Loading…
Cancel
Save