From 86581f98606a4eb977c027475d35d49bb67e45f3 Mon Sep 17 00:00:00 2001 From: leMicin Date: Sat, 2 Jan 2021 04:18:37 -0500 Subject: [PATCH] Parse contracts Fixes #476 --- src/Sidekick.Domain/Game/Items/Models/Category.cs | 3 ++- .../PoeApi/Items/Metadatas/ItemMetadataProvider.cs | 1 + src/Sidekick.Infrastructure/PoeApi/Trade/TradeSearchService.cs | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Sidekick.Domain/Game/Items/Models/Category.cs b/src/Sidekick.Domain/Game/Items/Models/Category.cs index b440a522..49dba884 100644 --- a/src/Sidekick.Domain/Game/Items/Models/Category.cs +++ b/src/Sidekick.Domain/Game/Items/Models/Category.cs @@ -15,6 +15,7 @@ public enum Category Leaguestone = 10, Prophecy = 11, ItemisedMonster = 12, - Watchstone = 13 + Watchstone = 13, + Contract = 14, } } diff --git a/src/Sidekick.Infrastructure/PoeApi/Items/Metadatas/ItemMetadataProvider.cs b/src/Sidekick.Infrastructure/PoeApi/Items/Metadatas/ItemMetadataProvider.cs index 28588858..71d7ee11 100644 --- a/src/Sidekick.Infrastructure/PoeApi/Items/Metadatas/ItemMetadataProvider.cs +++ b/src/Sidekick.Infrastructure/PoeApi/Items/Metadatas/ItemMetadataProvider.cs @@ -54,6 +54,7 @@ public async Task Initialize() FillPattern(result.Result[10].Entries, Category.Prophecy); FillPattern(result.Result[11].Entries, Category.ItemisedMonster, useRegex: true); FillPattern(result.Result[12].Entries, Category.Watchstone); + FillPattern(result.Result[14].Entries, Category.Contract, useRegex: true); Prefixes = new[] { diff --git a/src/Sidekick.Infrastructure/PoeApi/Trade/TradeSearchService.cs b/src/Sidekick.Infrastructure/PoeApi/Trade/TradeSearchService.cs index f65006c9..d0936900 100644 --- a/src/Sidekick.Infrastructure/PoeApi/Trade/TradeSearchService.cs +++ b/src/Sidekick.Infrastructure/PoeApi/Trade/TradeSearchService.cs @@ -421,7 +421,6 @@ private List ParseHash(List> values) private List ParseLineContents(List lines) { return lines? - .OrderBy(x => x.Order) .Select(line => { var values = new List();