@@ -408,6 +408,36 @@ function ADB:AHendOfScanCB()
408
408
end
409
409
end
410
410
411
+ function ADB :ItemInfoScan ()
412
+ local idb = self .savedVar [self .itemDBKey ]
413
+ ADB :PrintDefault (L [" Scanning item db for item info, starting with % items, % with info" ], idb ._count_ , idb ._infoCount_ )
414
+ local count = 0
415
+ local infoCount = 0
416
+ for key , link in pairs (idb ) do
417
+ if key :sub (1 ,1 ) == " _" then
418
+ ADB :PrintDefault (L [" Meta information key % value %" ], key , link )
419
+ else
420
+ count = count + 1
421
+ if ADB :HasItemInfo (link ) then
422
+ infoCount = infoCount + 1
423
+ else
424
+ local added
425
+ idb [key ], added = ADB :AddItemInfo (link )
426
+ infoCount = infoCount + added
427
+ idb ._infoCount_ = idb ._infoCount_ + added
428
+ end
429
+ end
430
+ end
431
+ ADB :PrintDefault (L [" Found % total items and % with info" ], count , infoCount )
432
+ if idb ._count_ ~= count then
433
+ ADB :Warning (" Mismatch in count % vs %" , count , idb ._count_ )
434
+ end
435
+ if idb ._infoCount_ ~= infoCount then
436
+ ADB :Warning (" Fixing mismatch in info count % (was %)" , infoCount , idb ._infoCount_ )
437
+ idb ._infoCount_ = infoCount
438
+ end
439
+ end
440
+
411
441
function ADB :Help (msg )
412
442
ADB :PrintDefault (" AHDB: " .. msg .. " \n " .. " /ahdb config -- open addon config\n " ..
413
443
" /ahdb scan -- manual full scan\n " .. " /ahdb bug -- report a bug\n " ..
@@ -440,6 +470,8 @@ function ADB.Slash(arg) -- can't be a : because used directly as slash command
440
470
ADB :AHSaveAll ()
441
471
elseif ADB :StartsWith (arg , " context" ) then
442
472
ADB :AHContext ()
473
+ elseif ADB :StartsWith (arg , " infoscan" ) then
474
+ ADB :ItemInfoScan ()
443
475
elseif cmd == " c" then
444
476
-- Show config panel
445
477
-- InterfaceOptionsList_DisplayPanel(ADB.optionsPanel)
0 commit comments