From e65d701e0a10cdf4b465b8bd998091a042922310 Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Sun, 15 Mar 2020 02:08:20 +0000 Subject: [PATCH] Show sum of entries and titles count when displaying the number of entries --- src/library.cr | 4 ++++ src/views/index.ecr | 2 +- src/views/title.ecr | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/library.cr b/src/library.cr index a5e22ed..d1d4fdd 100644 --- a/src/library.cr +++ b/src/library.cr @@ -154,6 +154,10 @@ class Title ary end + def size + @entries.size + @title_ids.size + end + # When downloading from MangaDex, the zip/cbz file would not be valid # before the download is completed. If we scan the zip file, # Entry.new would throw, so we use this method to check before diff --git a/src/views/index.ecr b/src/views/index.ecr index 15cb974..c90aaf9 100644 --- a/src/views/index.ecr +++ b/src/views/index.ecr @@ -33,7 +33,7 @@
<%= (percentage[i] * 100).round(1) %>%

<%= t.title %>

-

<%= t.entries.size %> entries

+

<%= t.size %> entries

diff --git a/src/views/title.ecr b/src/views/title.ecr index 49281ec..d25df90 100644 --- a/src/views/title.ecr +++ b/src/views/title.ecr @@ -6,7 +6,7 @@ <%- end -%>
  • <%= title.title %>
  • -

    <%= title.entries.size %> entries found

    +

    <%= title.size %> entries found