Skip to content

Commit e4ca9b0

Browse files
author
Justin Skiles
committed
Fix issue where default visibility on published file details was incorrect.
1 parent 39f163f commit e4ca9b0

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
namespace Steam.Models
22
{
3-
public enum PublishedFileVisibility
3+
public enum PublishedFileVisibility : uint
44
{
55
Public = 0,
6-
FreindsOnly = 1,
7-
Private = 2
6+
FriendsOnly = 1,
7+
Private = 2,
8+
Unknown = 3
89
}
910
}

src/Steam.Models/Steam.Models.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Description>Contains classes that are used as data transports between various application, business, and data layers for Steam related APIs.</Description>
5-
<VersionPrefix>3.0.10</VersionPrefix>
6-
<Authors>Justin Skiles</Authors>
7-
<AssemblyName>Steam.Models</AssemblyName>
8-
<PackageId>Steam.Models</PackageId>
9-
<PackageProjectUrl>https://github.com/babelshift/Steam.Models</PackageProjectUrl>
10-
<PackageLicenseUrl>https://raw.githubusercontent.com/babelshift/Steam.Models/master/LICENSE</PackageLicenseUrl>
114
<TargetFramework>netstandard2.0</TargetFramework>
125
</PropertyGroup>
136

src/Steam.UnitTests/Steam.UnitTests.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
<UserSecretsId>46a53f4e-b4d4-4fad-b7c9-b777001cfe42</UserSecretsId>
77
</PropertyGroup>
88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.3" />
10-
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.3" />
9+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.4" />
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
11+
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.4" />
1112
<PackageReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.2" />
1213
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
1314
<PackageReference Include="xunit" Version="2.4.0" />

src/Steam.UnitTests/SteamRemoteTests.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Steam.Models;
12
using SteamWebAPI2.Interfaces;
23
using System.Net.Http;
34
using System.Threading.Tasks;
@@ -15,11 +16,21 @@ public SteamRemoteTests()
1516
}
1617

1718
[Fact]
18-
public async Task GetPublishedFileDetailsAsync_Should_Succeed()
19+
public async Task GetPublishedFileDetailsAsync_Public_Visibility_Should_Succeed()
1920
{
2021
var response = await steamInterface.GetPublishedFileDetailsAsync(1673456286);
2122
Assert.NotNull(response);
2223
Assert.NotNull(response.Data);
24+
Assert.Equal(PublishedFileVisibility.Public, response.Data.Visibility);
25+
}
26+
27+
[Fact]
28+
public async Task GetPublishedFileDetailsAsync_Unknown_Visibility_Should_Succeed()
29+
{
30+
var response = await steamInterface.GetPublishedFileDetailsAsync(2097579725);
31+
Assert.NotNull(response);
32+
Assert.NotNull(response.Data);
33+
Assert.Equal(PublishedFileVisibility.Unknown, response.Data.Visibility);
2334
}
2435
}
2536
}

src/SteamWebAPI2/Models/PublishedFileDetailsResultContainer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using Newtonsoft.Json;
22
using System;
33
using System.Collections.Generic;
4+
using Steam.Models;
5+
using SteamWebAPI2.Utilities.JsonConverters;
46

57
namespace SteamWebAPI2.Models
68
{
7-
using SteamWebAPI2.Utilities.JsonConverters;
8-
99
internal class PublishedFileDetailsResultContainer
1010
{
1111
[JsonProperty("response")]
@@ -74,7 +74,7 @@ internal class PublishedFileDetails
7474
public DateTime TimeUpdated { get; set; }
7575

7676
[JsonProperty("visibility")]
77-
public uint Visibility { get; set; }
77+
public uint Visibility { get; set; } = (uint)PublishedFileVisibility.Unknown;
7878

7979
[JsonProperty("banned")]
8080
public bool Banned { get; set; }

src/SteamWebAPI2/SteamWebAPI2.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Description>This is a .NET library that makes it easy to use the Steam Web API. It conveniently wraps around all of the JSON data and ugly API details with clean methods, structures and classes.</Description>
5-
<VersionPrefix>4.2.3</VersionPrefix>
5+
<VersionPrefix>4.2.4</VersionPrefix>
66
<Authors>Justin Skiles</Authors>
77
<AssemblyName>SteamWebAPI2</AssemblyName>
88
<PackageId>SteamWebAPI2</PackageId>
@@ -16,8 +16,8 @@
1616
</PropertyGroup>
1717
<ItemGroup>
1818
<PackageReference Include="automapper" Version="9.0.0" />
19-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.3" />
20-
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.3" />
19+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
20+
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.4" />
2121
<PackageReference Include="newtonsoft.json" Version="12.0.3" />
2222
</ItemGroup>
2323

0 commit comments

Comments
 (0)