Skip to content

Commit bd31a01

Browse files
committed
ReviewViewer: Fix max playtime not treated as infinite when set to 100 in request logic
1 parent be7befc commit bd31a01

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

source/Generic/ReviewViewer/Infrastructure/SteamReviewsService.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,24 @@ private string BuildUrl(int appId, QueryOptions opt, string cursor)
145145

146146
if (opt.PlaytimePreset == PlaytimePreset.None)
147147
{
148-
sb.Append($"&playtime_filter_min=0");
149-
sb.Append($"&playtime_filter_max=0");
148+
sb.Append("&playtime_filter_min=0");
149+
sb.Append("&playtime_filter_max=0");
150150
}
151151
else if (opt.PlaytimePreset == PlaytimePreset.Over1Hour)
152152
{
153153
sb.Append("&playtime_filter_min=1");
154+
sb.Append("&playtime_filter_max=0");
154155
}
155156
else if (opt.PlaytimePreset == PlaytimePreset.Over10Hours)
156157
{
157158
sb.Append("&playtime_filter_min=10");
159+
sb.Append("&playtime_filter_max=0");
158160
}
159161
else if (opt.PlaytimePreset == PlaytimePreset.Custom)
160162
{
161163
sb.Append($"&playtime_filter_min={opt.CustomPlaytimeMinHours}");
162-
sb.Append($"&playtime_filter_max={opt.CustomPlaytimeMaxHours}");
164+
var maxFilter = opt.CustomPlaytimeMaxHours == 100 ? 0 : opt.CustomPlaytimeMaxHours;
165+
sb.Append($"&playtime_filter_max={maxFilter}");
163166
}
164167

165168
switch (opt.PlaytimeDevice)

source/Generic/ReviewViewer/Presentation/ReviewsControl.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@
228228
<TextBlock Text="Minimum Playtime (hours)" Margin="0,5,0,0" />
229229
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
230230
<Slider Minimum="0" Maximum="100" Value="{Binding QueryOptions.CustomPlaytimeMinHours}" Width="150" VerticalAlignment="Center" />
231-
<TextBlock Text="{Binding QueryOptions.CustomPlaytimeMinHours, Converter={StaticResource IntSubstitutionConverter}, ConverterParameter='0=∅;100=∞'}"
231+
<TextBlock Text="{Binding QueryOptions.CustomPlaytimeMinHours, Converter={StaticResource IntSubstitutionConverter}}"
232232
Margin="10,0,0,0" VerticalAlignment="Center" />
233233
</StackPanel>
234234

235235
<TextBlock Text="Maximum Playtime (hours)" Margin="0,5,0,0" />
236236
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
237237
<Slider Minimum="0" Maximum="100" Value="{Binding QueryOptions.CustomPlaytimeMaxHours}" Width="150" VerticalAlignment="Center" />
238-
<TextBlock Text="{Binding QueryOptions.CustomPlaytimeMaxHours, Converter={StaticResource IntSubstitutionConverter}, ConverterParameter='0=;100=∞'}"
238+
<TextBlock Text="{Binding QueryOptions.CustomPlaytimeMaxHours, Converter={StaticResource IntSubstitutionConverter}, ConverterParameter='0=;100=∞'}"
239239
Margin="10,0,0,0" VerticalAlignment="Center" />
240240
</StackPanel>
241241
</StackPanel>

0 commit comments

Comments
 (0)