Overview should also use calculated equivalent counts

This commit is contained in:
Max
2026-06-01 21:23:08 +02:00
parent fb7bcf5780
commit 3114e0ae7f
+13 -2
View File
@@ -495,6 +495,17 @@ local function getEquivalentLevelCounts(baseId, pageItems, itemCounts)
return equivalentCounts return equivalentCounts
end end
local function getEquivalentBaseCounts(baseIds, itemCounts)
local equivalentCounts = {}
for i = 1, #baseIds do
local baseId = baseIds[i]
equivalentCounts[baseId] = getBaseEquivalentCount(baseId, itemCounts)
end
return equivalentCounts
end
local function createGlobalCountRefreshJob() local function createGlobalCountRefreshJob()
ensureChainsLoaded() ensureChainsLoaded()
@@ -1146,7 +1157,7 @@ drawOverview = function()
local counts = getGlobalItemCounts() local counts = getGlobalItemCounts()
if next(counts) ~= nil then if next(counts) ~= nil then
overviewCachedCounts = counts overviewCachedCounts = getEquivalentBaseCounts(items, counts)
end end
return overviewCachedCounts return overviewCachedCounts
@@ -1159,7 +1170,7 @@ drawOverview = function()
overviewScrollTargetRow = targetRow overviewScrollTargetRow = targetRow
end, end,
getEntriesAndCountsFromCache = function() getEntriesAndCountsFromCache = function()
overviewCachedCounts = getGlobalItemCounts() overviewCachedCounts = getEquivalentBaseCounts(items, getGlobalItemCounts())
overviewCachedSortedItemIds = sortOverviewItems(overviewCachedCounts) overviewCachedSortedItemIds = sortOverviewItems(overviewCachedCounts)
return overviewCachedSortedItemIds, overviewCachedCounts return overviewCachedSortedItemIds, overviewCachedCounts
end, end,