Skip to content

Commit 3195066

Browse files
committed
Removed automatically search for currency setting. The currency exchange data is more accurate.
1 parent 1f5d3cf commit 3195066

File tree

8 files changed

+34
-153
lines changed

8 files changed

+34
-153
lines changed

src/Sidekick.Common/Settings/DefaultSettings.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public static class DefaultSettings
4747

4848
public static bool PriceCheckAutomaticallySearch => false;
4949

50-
public static bool PriceCheckAutomaticallySearchCurrency => false;
51-
5250
public static bool PriceCheckEnableAllFilters => false;
5351

5452
public static string PriceCheckEnableFiltersByRegex => "";
@@ -59,8 +57,6 @@ public static class DefaultSettings
5957

6058
public static int PriceCheckBulkMinimumStock => 5;
6159

62-
public static string PriceCheckCurrencyMode => "item";
63-
6460
public static string? PriceCheckCurrency => null;
6561

6662
public static string? PriceCheckCurrencyPoE2 => null;

src/Sidekick.Common/Settings/SettingKeys.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,12 @@ public static class SettingKeys
4848
public const string PriceCheckItemCurrencyMax = nameof(PriceCheckItemCurrencyMax);
4949
public const string PriceCheckItemCurrencyMaxPoE2 = nameof(PriceCheckItemCurrencyMaxPoE2);
5050
public const string PriceCheckBulkMinimumStock = nameof(PriceCheckBulkMinimumStock);
51-
public const string PriceCheckCurrencyMode = nameof(PriceCheckCurrencyMode);
5251
public const string PriceCheckNormalizeValue = nameof(PriceCheckNormalizeValue);
5352
public const string PriceCheckCompactMode = nameof(PriceCheckCompactMode);
5453
public const string PriceCheckSidebarWidth = nameof(PriceCheckSidebarWidth);
5554
public const string PriceCheckStatus = nameof(PriceCheckStatus);
5655
public const string PriceCheckItemClassFilter = nameof(PriceCheckItemClassFilter);
5756
public const string PriceCheckAutomaticallySearch = nameof(PriceCheckAutomaticallySearch);
58-
public const string PriceCheckAutomaticallySearchCurrency = nameof(PriceCheckAutomaticallySearchCurrency);
5957
public const string PriceCheckEnableAllFilters = nameof(PriceCheckEnableAllFilters);
6058
public const string PriceCheckEnableFiltersByRegex = nameof(PriceCheckEnableFiltersByRegex);
6159
public const string PriceCheckDefaultFilterType = nameof(PriceCheckDefaultFilterType);

src/Sidekick.Modules.Trade/Localization/TradeResources.fr.resx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,6 @@ Cliquez sur le bouton pour l'ouvrir dans votre navigateur.</value>
226226
<data name="Minimum_Stock_in_Bulk_Trade" xml:space="preserve">
227227
<value>Stock disponible de la vente en gros</value>
228228
</data>
229-
<data name="Preferred_search_mode_for_currency_items" xml:space="preserve">
230-
<value>Mode de recherche pour les devises</value>
231-
</data>
232229
<data name="Currency_of_Results" xml:space="preserve">
233230
<value>Devise des résultats</value>
234231
</data>
@@ -280,9 +277,6 @@ Cliquez sur le bouton pour l'ouvrir dans votre navigateur.</value>
280277
<data name="PriceCheck_Automatically_Search" xml:space="preserve">
281278
<value>Rechercher automatiquement lors de la vérification du prix</value>
282279
</data>
283-
<data name="PriceCheck_Automatically_Search_Currency" xml:space="preserve">
284-
<value>Rechercher automatiquement les devises lors de la vérification du prix</value>
285-
</data>
286280
<data name="Setting_Rate_Limit_Hint" xml:space="preserve">
287281
<value>Il est recommandé de laisser désactivé afin de ne pas dépasser la limite de taux de l'API.</value>
288282
</data>

src/Sidekick.Modules.Trade/Localization/TradeResources.ko.resx

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
@@ -186,9 +186,6 @@
186186
<data name="PriceCheck_Automatically_Load_More_Data" xml:space="preserve">
187187
<value />
188188
</data>
189-
<data name="PriceCheck_Automatically_Search_Currency" xml:space="preserve">
190-
<value />
191-
</data>
192189
<data name="Setting_Rate_Limit_Hint" xml:space="preserve">
193190
<value />
194191
</data>

src/Sidekick.Modules.Trade/Localization/TradeResources.resx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,6 @@ Click the button to open in your browser.</value>
226226
<data name="Minimum_Stock_in_Bulk_Trade" xml:space="preserve">
227227
<value>Minimum Stock in Bulk Trade</value>
228228
</data>
229-
<data name="Preferred_search_mode_for_currency_items" xml:space="preserve">
230-
<value>Preferred search mode for currency items</value>
231-
</data>
232229
<data name="Currency_of_Results" xml:space="preserve">
233230
<value>Currency of Results</value>
234231
</data>
@@ -283,9 +280,6 @@ Click the button to open in your browser.</value>
283280
<data name="PriceCheck_Automatically_Search" xml:space="preserve">
284281
<value>Automatically search for items when price checking</value>
285282
</data>
286-
<data name="PriceCheck_Automatically_Search_Currency" xml:space="preserve">
287-
<value>Automatically search for currencies when price checking</value>
288-
</data>
289283
<data name="Setting_Rate_Limit_Hint" xml:space="preserve">
290284
<value>It is recommended to leave disabled to avoid exceeding the API rate limit.</value>
291285
</data>

src/Sidekick.Modules.Trade/Settings/PriceCheckCurrencyModeEditor.razor

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/Sidekick.Modules.Trade/Settings/SettingsContent.razor

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
<FormFieldset Legend="@Resources["Behaviour_Settings"]">
2929
<AlertInfo>@Resources["Rate_Limit_Disclaimer"]</AlertInfo>
3030
<SettingCheckboxEditor SettingKey="@SettingKeys.PriceCheckAutomaticallySearch" Label="@Resources["PriceCheck_Automatically_Search"]" Tooltip="@Resources["Setting_Rate_Limit_Hint"]"/>
31-
<SettingCheckboxEditor SettingKey="@SettingKeys.PriceCheckAutomaticallySearchCurrency" Label="@Resources["PriceCheck_Automatically_Search_Currency"]" Tooltip="@Resources["Setting_Rate_Limit_Hint"]"/>
3231
<SettingCheckboxEditor SettingKey="@SettingKeys.PriceCheckAutomaticallyLoadMoreData" Label="@Resources["PriceCheck_Automatically_Load_More_Data"]" Tooltip="@Resources["Setting_Rate_Limit_Hint"]"/>
33-
<PriceCheckCurrencyModeEditor/>
3432
</FormFieldset>
3533

3634
<div class="flex justify-center mb-1">
@@ -53,13 +51,10 @@
5351
SettingKeys.PriceCheckNormalizeValue,
5452
SettingKeys.PriceCheckPredictionEnabled,
5553
SettingKeys.PriceCheckAutomaticallySearch,
56-
SettingKeys.PriceCheckAutomaticallySearchCurrency,
5754
SettingKeys.PriceCheckEnableAllFilters,
5855
SettingKeys.PriceCheckEnableFiltersByRegex,
5956
SettingKeys.PriceCheckAutomaticallyLoadMoreData,
6057
SettingKeys.PriceCheckDefaultFilterType,
61-
62-
SettingKeys.PriceCheckCurrencyMode,
6358
};
6459

6560
protected override async Task OnInitializedAsync()

src/Sidekick.Modules.Trade/Trade/Filters/FiltersComponent.razor

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
@using Sidekick.Apis.Poe.Trade.Parser.Pseudo.Filters
88
@using Sidekick.Common.Settings
99
@using Sidekick.Modules.Trade.Localization
10-
@using Sidekick.Modules.Trade.PoeNinja
1110
@using Sidekick.Modules.Trade.PoePrices
1211
@using Sidekick.Modules.Trade.Trade.Filters.Properties
1312
@using ItemHeader = Sidekick.Common.Ui.Poe.Items.ItemHeader
@@ -93,22 +92,15 @@
9392
ModifierFilters = await ModifierParser.GetFilters(Item);
9493
PseudoFilters = PseudoParser.GetFilters(Item);
9594

96-
var automaticallyPriceCheckSettingKey = Item.Properties.Rarity == Rarity.Currency ?
97-
SettingKeys.PriceCheckAutomaticallySearchCurrency :
98-
SettingKeys.PriceCheckAutomaticallySearch;
99-
var automaticallyPriceCheck = await SettingsService.GetBool(automaticallyPriceCheckSettingKey);
95+
var automaticallyPriceCheck = false;
96+
if (Item.Properties.Rarity != Rarity.Currency)
97+
{
98+
automaticallyPriceCheck = await SettingsService.GetBool(SettingKeys.PriceCheckAutomaticallySearch);
99+
}
100+
100101
if (automaticallyPriceCheck)
101102
{
102-
var mode = TradeMode.Item;
103-
if (BulkTradeService.SupportsBulkTrade(Item))
104-
{
105-
mode = await SettingsService.GetEnum<TradeMode>(SettingKeys.PriceCheckCurrencyMode) ?? TradeMode.Item;
106-
}
107-
108-
if (mode == TradeMode.Bulk)
109-
await TradeService.SearchBulk(Item);
110-
else
111-
await TradeService.SearchItems(Item, PropertyFilters, ModifierFilters, PseudoFilters);
103+
await TradeService.SearchItems(Item, PropertyFilters, ModifierFilters, PseudoFilters);
112104
}
113105
else
114106
{

0 commit comments

Comments
 (0)