From 293fb84e1d33e621a346d3c2cc419953e762e8fb Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Tue, 22 Mar 2022 16:04:39 +0000 Subject: [PATCH] Formatting --- src/library/library.cr | 3 ++- src/library/title.cr | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/library/library.cr b/src/library/library.cr index 18a0772..2da4c86 100644 --- a/src/library/library.cr +++ b/src/library/library.cr @@ -139,7 +139,8 @@ class Library titles.flat_map &.deep_entries end - def build_json(*, slim = false, depth = -1, sort_context = nil, percentage = false) + def build_json(*, slim = false, depth = -1, sort_context = nil, + percentage = false) _titles = if sort_context sorted_titles sort_context[:username], sort_context[:opt] diff --git a/src/library/title.cr b/src/library/title.cr index 4125501..e3d79d5 100644 --- a/src/library/title.cr +++ b/src/library/title.cr @@ -256,8 +256,11 @@ class Title end json.field "entry_percentages" do json.array do - load_percentage_for_all_entries(sort_context[:username], sort_context[:opt]).each do |percentage| - json.number percentage.nan? ? 0 : percentage + load_percentage_for_all_entries( + sort_context[:username], + sort_context[:opt] + ).each do |p| + json.number p.nan? ? 0 : p end end end