From 042eb660e80324a72d8ac63306b6b618449841e3 Mon Sep 17 00:00:00 2001 From: robert00s Date: Tue, 24 Jan 2017 18:51:42 +0100 Subject: [PATCH] Can't display the doc name in Statistics page --- plugins/statistics.koplugin/main.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/statistics.koplugin/main.lua b/plugins/statistics.koplugin/main.lua index e39ad8705..71c8bbca3 100755 --- a/plugins/statistics.koplugin/main.lua +++ b/plugins/statistics.koplugin/main.lua @@ -453,6 +453,10 @@ end function ReaderStatistics:getTotalStats() local total_stats = {} if not self:isDocless() then + -- empty title + if self.data.title == "" then + self.data.title = self.document.file:match("^.+/(.+)$") + end total_stats = { { self.data.title, @@ -481,6 +485,10 @@ function ReaderStatistics:getStatisticsFromHistory(total_stats) local total_books_time = 0 for _, v in pairs(ReadHistory.hist) do local book_stats = DocSettings:open(v.file):readSetting('stats') + -- empty title + if book_stats and book_stats.title == "" then + book_stats.title = v.file:match("^.+/(.+)$") + end if book_stats and book_stats.total_time_in_sec > 0 and book_stats.title ~= self.data.title then titles[book_stats.title] = true