This commit is contained in:
bryanthaboi
2026-10-02 16:03:51 -04:00
2 changed files with 25 additions and 0 deletions
+4
View File
@@ -8501,8 +8501,12 @@ function RomImporter:_queueFindEnrichment()
if not visible then return end
local thumbnails, stats = 0, 0
for _, entry in ipairs(visible) do
-- A row already resolved to "failed" (or with no thumbnail at all) must not
-- spend this frame's allowance: _startFindThumb ignores it, so counting it
-- let two dead rows above a card starve it of a download forever.
if thumbnails < FIND_ENRICH_PER_FRAME
and self:_findThumb(entry) == nil
and not (self._findThumbs and self._findThumbs[entry.id] ~= nil)
and not self:_findThumbPending(entry.id) then
self:_startFindThumb(entry)
thumbnails = thumbnails + 1
+21
View File
@@ -65,6 +65,27 @@ do
"update schedules a bounded thumbnail and stats batch for visible rows")
end
-- Rows already resolved to "failed" (or with no thumbnail) must not spend the
-- per-frame download allowance, or two of them above a card starve it forever.
do
local started = {}
local imp = setmetatable({ tab = "find", findLoaded = true,
_findThumbs = { dead1 = false, dead2 = false },
_findVisibleEntries = {
{ id = "dead1", thumbnail = "https://example.invalid/1.png" },
{ id = "dead2", thumbnail = "https://example.invalid/2.png" },
{ id = "dead3" },
{ id = "alive", thumbnail = "https://example.invalid/alive.png" },
} }, RomImporter)
imp._findThumbPending = function() return false end
imp._findStatsCached = function() return {} end
imp._startFindThumb = function(_, entry) started[#started + 1] = entry.id end
imp:_queueFindEnrichment()
eq(#started, 1, "only the row that can load starts a download")
eq(started[1], "alive",
"dead rows above a card do not starve it of its download")
end
do
local requests = 0
local imp = setmetatable({}, RomImporter)