Skip to content

Commit

Permalink
Merge pull request #198 from Sidekick-Poe/bugfix/undocumented-api-cha…
Browse files Browse the repository at this point in the history
…nges

Update MetadataProvider.cs
  • Loading branch information
leMicin authored Jul 27, 2024
2 parents 796149e + 99e836e commit 312acc2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 58 deletions.
22 changes: 11 additions & 11 deletions src/Sidekick.Apis.Poe/Metadatas/MetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ public async Task Initialize()
"Metadata",
() => poeTradeClient.Fetch<ApiCategory>("data/items"));

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, "azmeri", Category.Affliction, useRegex: true);
//FillPattern(result.Result, "necropolis", Category.EmbersOfTheAllflame, useRegex: true);
}

private void FillPattern(List<ApiCategory> categories, string id, Category category, bool useRegex = false)
Expand Down
10 changes: 4 additions & 6 deletions tests/Sidekick.Apis.Poe.Tests/Parser/DelveParsing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,20 @@ public void PerfectFossil()
{
var actual = parser.ParseItem(@"Item Class: Stackable Currency
Rarity: Currency
Perfect Fossil
Opulent Fossil
--------
Stack Size: 1/20
Applies to: Weapons, Body Armour, Gloves, Boots, Helmets, Shields, Maps
--------
Improved Quality
More Drop modifiers
No Tagless modifiers
--------
Place in a Resonator to influence item crafting.
--------
Note: ~price 4 chaos
");

Assert.Equal(Class.StackableCurrency, actual.Header.Class);
Assert.Equal(Rarity.Currency, actual.Metadata.Rarity);
Assert.Equal(Category.Currency, actual.Metadata.Category);
Assert.Equal("Perfect Fossil", actual.Metadata.Type);
Assert.Equal("Opulent Fossil", actual.Metadata.Type);
}
}
}
39 changes: 0 additions & 39 deletions tests/Sidekick.Apis.Poe.Tests/Parser/NecropolisParsing.cs

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Sidekick.Apis.Poe.Tests/Parser/WeaponParsing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ Imbued Wand
--------
Adds 10 to 16 Physical Damage
24% increased Fire Damage
14% increased Critical Strike Chance for Spells
Attacks with this Weapon Penetrate 10% Lightning Resistance
--------
Crusader Item
Expand All @@ -82,7 +81,6 @@ Crusader Item
actual.AssertHasModifier(ModifierCategory.Implicit, "#% increased Spell Damage", 33);
actual.AssertHasAlternateModifier(ModifierCategory.Explicit, "Adds # to # Physical Damage (Local)", 10, 16);
actual.AssertHasModifier(ModifierCategory.Explicit, "#% increased Fire Damage", 24);
actual.AssertHasModifier(ModifierCategory.Explicit, "#% increased Critical Strike Chance for Spells", 14);
actual.AssertHasModifier(ModifierCategory.Explicit, "Attacks with this Weapon Penetrate #% Lightning Resistance", 10);
}

Expand Down

0 comments on commit 312acc2

Please sign in to comment.