From b83313b231d3f5043000d8688d696672b71a04e3 Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Sat, 20 Jun 2020 09:36:30 +0000 Subject: [PATCH] Set recently added group range to 1 day --- src/library.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/library.cr b/src/library.cr index 8236ed6..6fdff2d 100644 --- a/src/library.cr +++ b/src/library.cr @@ -575,7 +575,8 @@ class Library .sort { |a, b| b.date_added <=> a.date_added } .each do |e| last = recently_added.last? - if last && e.title_id == last[:entry].title_id + if last && e.title_id == last[:entry].title_id && + (e.date_added - last[:entry].date_added).duration < 1.day # A NamedTuple is immutable, so we have to cast it to a Hash first last_hash = last.to_h count = last_hash[:grouped_count].as(Int32)