Skip to content

Commit

Permalink
Merge pull request #216 from Sidekick-Poe/bugfix/invariant-info
Browse files Browse the repository at this point in the history
Update InvariantMetadataProvider
  • Loading branch information
leMicin authored Aug 1, 2024
2 parents feab247 + 9e0af21 commit bf866d0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 83 deletions.
22 changes: 11 additions & 11 deletions src/Sidekick.Apis.Poe/Metadatas/InvariantMetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ public async Task Initialize()
"InvariantMetadata",
() => poeTradeClient.Fetch<ApiCategory>("data/items", useDefaultLanguage: true));

FillPattern(result.Result, "accessories", Category.Accessory, useRegex: true);
FillPattern(result.Result, "accessory", Category.Accessory, useRegex: true);
FillPattern(result.Result, "armour", Category.Armour, useRegex: true);
FillPattern(result.Result, "cards", Category.DivinationCard);
FillPattern(result.Result, "card", Category.DivinationCard);
FillPattern(result.Result, "currency", Category.Currency);
FillPattern(result.Result, "flasks", Category.Flask, useRegex: true);
FillPattern(result.Result, "gems", Category.Gem);
FillPattern(result.Result, "jewels", Category.Jewel, useRegex: true);
FillPattern(result.Result, "maps", Category.Map, useRegex: true);
FillPattern(result.Result, "weapons", Category.Weapon, useRegex: true);
FillPattern(result.Result, "leaguestones", Category.Leaguestone);
FillPattern(result.Result, "monsters", Category.ItemisedMonster, useRegex: true);
FillPattern(result.Result, "flask", Category.Flask, useRegex: true);
FillPattern(result.Result, "gem", Category.Gem);
FillPattern(result.Result, "jewel", Category.Jewel, useRegex: true);
FillPattern(result.Result, "map", Category.Map, useRegex: true);
FillPattern(result.Result, "weapon", Category.Weapon, useRegex: true);
FillPattern(result.Result, "leaguestone", Category.Leaguestone);
FillPattern(result.Result, "monster", Category.ItemisedMonster, useRegex: true);
FillPattern(result.Result, "heistequipment", Category.HeistEquipment, useRegex: true);
FillPattern(result.Result, "heistmission", Category.Contract, useRegex: true);
FillPattern(result.Result, "logbook", Category.Logbook, useRegex: true);
FillPattern(result.Result, "sanctum", Category.Sanctum, useRegex: true);
FillPattern(result.Result, "memoryline", Category.MemoryLine, useRegex: true);
FillPattern(result.Result, "azmeri", Category.Affliction, useRegex: true);
FillPattern(result.Result, "necropolis", Category.EmbersOfTheAllflame, useRegex: true);
FillPattern(result.Result, "tincture", Category.Tincture, useRegex: true);
FillPattern(result.Result, "corpse", Category.Corpse, useRegex: true);
}

private void FillPattern(List<ApiCategory> categories, string id, Category category, bool useRegex = false)
Expand Down
86 changes: 14 additions & 72 deletions src/Sidekick.Apis.Poe/Metadatas/MetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,82 +28,24 @@ public async Task Initialize()

var result = await cacheProvider.GetOrSet("Metadata", () => poeTradeClient.Fetch<ApiCategory>("data/items"));

FillPattern(
result.Result,
"accessory",
Category.Accessory,
useRegex: true);
FillPattern(
result.Result,
"armour",
Category.Armour,
useRegex: true);
FillPattern(result.Result, "accessory", Category.Accessory, useRegex: true);
FillPattern(result.Result, "armour", Category.Armour, useRegex: true);
FillPattern(result.Result, "card", Category.DivinationCard);
FillPattern(result.Result, "currency", Category.Currency);
FillPattern(
result.Result,
"flask",
Category.Flask,
useRegex: true);
FillPattern(result.Result, "flask", Category.Flask, useRegex: true);
FillPattern(result.Result, "gem", Category.Gem);
FillPattern(
result.Result,
"jewel",
Category.Jewel,
useRegex: true);
FillPattern(
result.Result,
"map",
Category.Map,
useRegex: true);
FillPattern(
result.Result,
"weapon",
Category.Weapon,
useRegex: true);
FillPattern(result.Result, "jewel", Category.Jewel, useRegex: true);
FillPattern(result.Result, "map", Category.Map, useRegex: true);
FillPattern(result.Result, "weapon", Category.Weapon, useRegex: true);
FillPattern(result.Result, "leaguestone", Category.Leaguestone);
FillPattern(
result.Result,
"monster",
Category.ItemisedMonster,
useRegex: true);
FillPattern(
result.Result,
"heistequipment",
Category.HeistEquipment,
useRegex: true);
FillPattern(
result.Result,
"heistmission",
Category.Contract,
useRegex: true);
FillPattern(
result.Result,
"logbook",
Category.Logbook,
useRegex: true);
FillPattern(
result.Result,
"sanctum",
Category.Sanctum,
useRegex: true);
FillPattern(
result.Result,
"memoryline",
Category.MemoryLine,
useRegex: true);

FillPattern(
result.Result,
"tincture",
Category.Tincture,
useRegex: true);

FillPattern(
result.Result,
"corpse",
Category.Corpse,
useRegex: true);
FillPattern(result.Result, "monster", Category.ItemisedMonster, useRegex: true);
FillPattern(result.Result, "heistequipment", Category.HeistEquipment, useRegex: true);
FillPattern(result.Result, "heistmission", Category.Contract, useRegex: true);
FillPattern(result.Result, "logbook", Category.Logbook, useRegex: true);
FillPattern(result.Result, "sanctum", Category.Sanctum, useRegex: true);
FillPattern(result.Result, "memoryline", Category.MemoryLine, useRegex: true);
FillPattern(result.Result, "tincture", Category.Tincture, useRegex: true);
FillPattern(result.Result, "corpse", Category.Corpse, useRegex: true);

//FillPattern(result.Result, "azmeri", Category.Affliction, useRegex: true);
//FillPattern(result.Result, "necropolis", Category.EmbersOfTheAllflame, useRegex: true);
Expand Down

0 comments on commit bf866d0

Please sign in to comment.