From 93b6335421dcc63321e1aac3526b005aa10da52a Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 17 Jul 2019 15:15:21 +0200 Subject: [PATCH] [statistics] Remove conversion message on new installations (#5120) --- .luacheckrc | 1 + plugins/statistics.koplugin/main.lua | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.luacheckrc b/.luacheckrc index e4ccc04b9..97e10b422 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -159,6 +159,7 @@ files["spec/unit/*"].globals = { -- 631 - Line is too long ignore = { "211/__*", + "231/__", "631", "dummy", } diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index f04882785..895b4edc6 100755 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -241,7 +241,13 @@ Do you want to create an empty database? else -- first time convertion to sqlite database self.convert_to_db = true if not conn:exec("pragma table_info('book');") then - if #ReadHistory.hist > 0 then + local filename_first_history, quickstart_filename, __ + if #ReadHistory.hist == 1 then + filename_first_history = ReadHistory.hist[1]["text"] + local quickstart_path = require("ui/quickstart").quickstart_filename + __, quickstart_filename = util.splitFilePathName(quickstart_path) + end + if #ReadHistory.hist > 1 or (#ReadHistory.hist == 1 and filename_first_history ~= quickstart_filename) then local info = InfoMessage:new{ text =_([[ New version of statistics plugin detected.