From d6aa3b9c8cce3179bb9eb674b0e096a820882d37 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Mon, 7 Nov 2016 21:17:01 -0800 Subject: [PATCH 1/3] ota: add new default server --- frontend/ui/otamanager.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/ui/otamanager.lua b/frontend/ui/otamanager.lua index 11e3407a9..04de3fce0 100644 --- a/frontend/ui/otamanager.lua +++ b/frontend/ui/otamanager.lua @@ -13,6 +13,7 @@ local ota_dir = DataStorage:getDataDir() .. "/ota/" local OTAManager = { ota_servers = { + "http://ota.koreader.rocks:80/", "http://vislab.bjmu.edu.cn:80/apps/koreader/ota/", "http://koreader-eu.ak-team.com:80/", "http://koreader-af.ak-team.com:80/", From 854043e18d95a3a50f88b770367219696640a0d7 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Mon, 7 Nov 2016 21:24:34 -0800 Subject: [PATCH 2/3] chore: fix all luacheck errors for plugins --- .luacheckrc | 1 + Makefile | 2 +- plugins/evernote.koplugin/clip.lua | 8 +++++--- plugins/evernote.koplugin/slt2.lua | 1 + plugins/statistics.koplugin/main.lua | 4 ++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 44bb008a9..694ccc435 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -8,6 +8,7 @@ globals = { } read_globals = { + "_ENV", "ANDROID_FONT_DIR", "KOBO_TOUCH_MIRRORED", "KOBO_SYNC_BRIGHTNESS_WITH_NICKEL", diff --git a/Makefile b/Makefile index c2a1bf10c..27b15162a 100644 --- a/Makefile +++ b/Makefile @@ -359,7 +359,7 @@ po: static-check: @if which luacheck > /dev/null; then \ - luacheck -q frontend; \ + luacheck -q frontend plugins; \ else \ echo "[!] luacheck not found. "\ "you can install it with 'luarocks install luacheck'"; \ diff --git a/plugins/evernote.koplugin/clip.lua b/plugins/evernote.koplugin/clip.lua index 3d1593013..57530fe92 100644 --- a/plugins/evernote.koplugin/clip.lua +++ b/plugins/evernote.koplugin/clip.lua @@ -57,7 +57,7 @@ function MyClipping:parseMyClippings() } elseif index == 2 then info = self:getInfo(line) - elseif index == 3 then + -- elseif index == 3 then -- should be a blank line, we skip this line elseif index == 4 then text = self:getText(line) @@ -168,8 +168,10 @@ function MyClipping:getTime(line) local _, _, hour, minute, second = line:find("(%d+):(%d+):(%d+)") if year and month and day and hour and minute and second then for k, v in pairs(pms) do - if line:find(k) then hour = hour + v end - break + if line:find(k) then + hour = hour + v + break + end end local time = os.time({ year = year, month = month, day = day, diff --git a/plugins/evernote.koplugin/slt2.lua b/plugins/evernote.koplugin/slt2.lua index 756ec485f..f1f1faba3 100644 --- a/plugins/evernote.koplugin/slt2.lua +++ b/plugins/evernote.koplugin/slt2.lua @@ -74,6 +74,7 @@ end function slt2.get_dependency(template, start_tag, end_tag) return stable_uniq(include_fold(template, start_tag, end_tag, function(acc, v, name) if type(v) == 'string' then + return acc elseif type(v) == 'table' then if name ~= nil then table.insert(acc, name) diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index c3a2dc5af..208a4707b 100755 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -125,13 +125,13 @@ function ReaderStatistics:updateSettings() text = "", input_type = "number", hint = T(_("Min seconds, default is 5. Current value: %1"), - self.page_min_read_sec), + self.page_min_read_sec), }, { text = "", input_type = "number", hint = T(_("Max seconds, default is 90. Current value: %1"), - self.page_max_read_sec), + self.page_max_read_sec), }, }, buttons = { From 8ff05707d20f9845a0702112c2b163f6e3984d35 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Mon, 7 Nov 2016 21:43:10 -0800 Subject: [PATCH 3/3] ota: support legacy kindle devices --- frontend/ui/otamanager.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/ui/otamanager.lua b/frontend/ui/otamanager.lua index 04de3fce0..4743732b6 100644 --- a/frontend/ui/otamanager.lua +++ b/frontend/ui/otamanager.lua @@ -38,7 +38,11 @@ local ota_channels = { function OTAManager:getOTAModel() if Device:isKindle() then - return "kindle" + if Device:isTouchDevice() then + return "kindle" + else + return "kindle-legacy" + end elseif Device:isKobo() then return "kobo" elseif Device:isPocketBook() then