@@ -575,6 +575,7 @@ function store.load()
575
575
end
576
576
577
577
store .packages_full = core .parse_json (response .data ) or {}
578
+ store .aliases = {}
578
579
579
580
for _ , package in pairs (store .packages_full ) do
580
581
local name_len = # package .name
@@ -583,6 +584,16 @@ function store.load()
583
584
else
584
585
package .id = package .author :lower () .. " /" .. package .name
585
586
end
587
+
588
+ if package .aliases then
589
+ for _ , alias in ipairs (package .aliases ) do
590
+ -- We currently don't support name changing
591
+ local suffix = " /" .. package .name
592
+ if alias :sub (-# suffix ) == suffix then
593
+ store .aliases [alias :lower ()] = package .id
594
+ end
595
+ end
596
+ end
586
597
end
587
598
588
599
store .packages_full_unordered = store .packages_full
@@ -595,22 +606,25 @@ function store.update_paths()
595
606
pkgmgr .refresh_globals ()
596
607
for _ , mod in pairs (pkgmgr .global_mods :get_list ()) do
597
608
if mod .author and mod .release > 0 then
598
- mod_hash [mod .author :lower () .. " /" .. mod .name ] = mod
609
+ local id = mod .author :lower () .. " /" .. mod .name
610
+ mod_hash [store .aliases [id ] or id ] = mod
599
611
end
600
612
end
601
613
602
614
local game_hash = {}
603
615
pkgmgr .update_gamelist ()
604
616
for _ , game in pairs (pkgmgr .games ) do
605
617
if game .author ~= " " and game .release > 0 then
606
- game_hash [game .author :lower () .. " /" .. game .id ] = game
618
+ local id = game .author :lower () .. " /" .. game .id
619
+ game_hash [store .aliases [id ] or id ] = game
607
620
end
608
621
end
609
622
610
623
local txp_hash = {}
611
624
for _ , txp in pairs (pkgmgr .get_texture_packs ()) do
612
625
if txp .author and txp .release > 0 then
613
- txp_hash [txp .author :lower () .. " /" .. txp .name ] = txp
626
+ local id = txp .author :lower () .. " /" .. txp .name
627
+ txp_hash [store .aliases [id ] or id ] = txp
614
628
end
615
629
end
616
630
0 commit comments