From 32d728714a57bf64aa25d0011e83744467c5e6b8 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Tue, 17 Jun 2014 12:56:12 +0200 Subject: [PATCH] * FIXED: Wrong file size in kiwix-serve home page --- src/server/kiwix-serve.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index 56dfd46..5f628fa 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -601,13 +601,14 @@ int main(int argc, char **argv) { string welcomeBooksHtml; for ( itr = booksIds.begin(); itr != booksIds.end(); ++itr ) { libraryManager.getBookById(*itr, currentBook); + if (!currentBook.path.empty() && readers.find(currentBook.getHumanReadableIdFromPath()) != readers.end()) { welcomeBooksHtml += "

" + currentBook.title + "

\ \ \
" + currentBook.description + "
" + - " \ \ \
Size: " + kiwix::beautifyInteger(atoi(currentBook.size.c_str())) + " MB (" + kiwix::beautifyInteger(atoi(currentBook.articleCount.c_str())) + " articles, " + kiwix::beautifyInteger(atoi(currentBook.mediaCount.c_str())) + " medias) \ + "
Size: " + kiwix::beautifyInteger(atoi(currentBook.size.c_str())/1024 != 0 ? atoi(currentBook.size.c_str())/1024 : 1) + " MB (" + kiwix::beautifyInteger(atoi(currentBook.articleCount.c_str())) + " articles, " + kiwix::beautifyInteger(atoi(currentBook.mediaCount.c_str())) + " medias) \ Created: " + currentBook.date + "
Author: " + currentBook.creator + "Language: " + currentBook.language + "
Publisher: " + (currentBook.publisher.empty() ? "unknown" : currentBook.publisher ) + "