mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Screensaver repair
Single picture as screensaver was not displayed anymore after the last update
This commit is contained in:
@@ -57,14 +57,26 @@ function Screensaver:show()
|
||||
if KOBO_SCREEN_SAVER_LAST_BOOK then
|
||||
local lastfile = G_reader_settings:readSetting("lastfile")
|
||||
self.suspend_msg = self:getCoverImage(lastfile)
|
||||
-- then screensaver directory image
|
||||
elseif type(KOBO_SCREEN_SAVER) == "string" then
|
||||
local file = KOBO_SCREEN_SAVER
|
||||
if lfs.attributes(file, "mode") == "directory" then
|
||||
if string.sub(file,string.len(file)) ~= "/" then
|
||||
file = file .. "/"
|
||||
end
|
||||
-- then screensaver directory or file image
|
||||
if not self.suspend_msg then
|
||||
if type(KOBO_SCREEN_SAVER) == "string" then
|
||||
local file = KOBO_SCREEN_SAVER
|
||||
if lfs.attributes(file, "mode") == "directory" then
|
||||
if string.sub(file,string.len(file)) ~= "/" then
|
||||
file = file .. "/"
|
||||
end
|
||||
self.suspend_msg = self:getRandomImage(file)
|
||||
else
|
||||
if lfs.attributes(file, "mode") == "file" then
|
||||
local ImageWidget = require("ui/widget/imagewidget")
|
||||
self.suspend_msg = ImageWidget:new{
|
||||
file = file,
|
||||
width = Screen:getWidth(),
|
||||
height = Screen:getHeight(),
|
||||
}
|
||||
end
|
||||
end
|
||||
self.suspend_msg = self:getRandomImage(file)
|
||||
end
|
||||
end
|
||||
-- fallback to suspended message
|
||||
|
||||
Reference in New Issue
Block a user