Screensaver: Fix a fallback snafu (#7397)

* Screensaver: Don't assume a missing show_message setting means that type
setting is, too.
reviewable/pr7398/r1
NiLuJe 3 years ago committed by GitHub
parent 08648d8870
commit 0674e6060a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -371,8 +371,8 @@ function Screensaver:setup(event, fallback_message)
if G_reader_settings:has("screensaver_show_message") then
self.show_message = G_reader_settings:isTrue("screensaver_show_message")
else
self.screensaver_type = "disable"
self.show_message = true
-- We only enable show_message as a *type* fallback!
self.show_message = false
end
if G_reader_settings:has("screensaver_type") then
self.screensaver_type = G_reader_settings:readSetting("screensaver_type")

@ -300,19 +300,19 @@ describe("OPDS module #nocov", function()
end)
it("should use the main URL for faceted links as long as faceted links aren't properly supported", function()
local catalog = OPDSParser:parse(facet_sample)
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.net/opds")
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.is/opds")
assert.truthy(item_table)
assert.are.same(item_table[2].url, "http://flibusta.net/opds/author/75357")
assert.are.same(item_table[2].url, "http://flibusta.is/opds/author/75357")
end)
end)
it("should not fill item table incorrectly with thumbnail or image URL", function()
local catalog = OPDSParser:parse(facet_sample)
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.net/opds")
local item_table = OPDSBrowser:genItemTableFromCatalog(catalog, "http://flibusta.is/opds")
assert.truthy(item_table)
assert.are_not.same(item_table[2].image, "http://flibusta.net/opds/author/75357")
assert.are_not.same(item_table[2].image, "http://flibusta.is/opds/author/75357")
end)
end)
end)

Loading…
Cancel
Save