Formatting

This commit is contained in:
Alex Ling 2022-03-22 16:04:39 +00:00
parent 9c07944390
commit 293fb84e1d
2 changed files with 7 additions and 3 deletions

View File

@ -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]

View File

@ -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