Skip to content

Commit

Permalink
Censored small nsfw thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
TekkaGB committed Sep 19, 2021
1 parent f4b2208 commit 93fef1b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Unverum/FeedGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private static string GenerateUrl(int page, GameFilter game, TypeFilter type, Fe
}
// Consistent args
url += $"_csvProperties=_sName,_sModelName,_sProfileUrl,_aSubmitter,_tsDateUpdated,_tsDateAdded,_aPreviewMedia,_sText,_sDescription,_aCategory,_aRootCategory,_aGame,_nViewCount," +
$"_nLikeCount,_nDownloadCount,_aFiles,_aModManagerIntegrations&_nPerpage={perPage}";
$"_nLikeCount,_nDownloadCount,_aFiles,_aModManagerIntegrations,_bIsNsfw&_nPerpage={perPage}";
if (!nsfw)
url += "&_aArgs[]=_sbIsNsfw = false";
// Sorting filter
Expand Down
2 changes: 2 additions & 0 deletions Unverum/Structures/GameBananaStructures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ private string ConvertHtmlToText(string html)
// Trim extra whitespace at start and end
return html.Trim();
}
[JsonPropertyName("_bIsNsfw")]
public bool IsNsfw { get; set; }
}
public class GameBananaModList
{
Expand Down
13 changes: 12 additions & 1 deletion Unverum/UI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TextBlock VerticalAlignment="Center" Panel.ZIndex="4" FontSize="40" FontWeight="Bold" HorizontalAlignment="Center" Text="SPOILER" Foreground="#f2f2f2">
<TextBlock VerticalAlignment="Center" Panel.ZIndex="4" FontSize="40" FontWeight="Bold" HorizontalAlignment="Center" Foreground="#f2f2f2">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsSpoiler}" Value="True">
<Setter Property="Visibility" Value="Visible" />
<Setter Property="Text" Value="SPOILER"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsNsfw}" Value="True">
<Setter Property="Visibility" Value="Visible" />
<Setter Property="Text" Value="NSFW"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand All @@ -51,6 +56,9 @@
<DataTrigger Binding="{Binding Path=IsSpoiler}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsNsfw}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
Expand All @@ -67,6 +75,9 @@
<DataTrigger Binding="{Binding Path=IsSpoiler}" Value="False">
<Setter Property="Effect" Value="{x:Null}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsNsfw}" Value="True">
<Setter Property="Effect" Value="{x:Null}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
Expand Down
2 changes: 1 addition & 1 deletion Unverum/Unverum.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<UseWPF>true</UseWPF>
<ApplicationIcon>Assets\unverum.ico</ApplicationIcon>
<AssemblyName>Unverum</AssemblyName>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<AssemblyVersion>1.3.1.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 93fef1b

Please sign in to comment.