Skip to content

Commit fbce247

Browse files
authored
Merge pull request #11 from Zechiax/feature_urlMethods
Feature url methods
2 parents 1f88333 + 093ed28 commit fbce247

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

Modrinth.RestClient.Test/TestApi.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
using System.Net;
2-
using System.Runtime.CompilerServices;
3-
using NUnit.Framework.Internal.Commands;
4-
using RestEase;
5-
61
namespace Modrinth.RestClient.Test;
72

83
public class Tests
@@ -12,7 +7,7 @@ public class Tests
127
[SetUp]
138
public void Setup()
149
{
15-
_api = ModrinthApi.NewClient(userAgent: "Modrinth.RestClient.Test");
10+
_api = ModrinthApi.NewClient(userAgent: "Zechiax/Modrinth.RestClient.Test");
1611
}
1712

1813
[Test]

Modrinth.RestClient/Models/TeamMember.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ namespace Modrinth.RestClient.Models;
99
/// </summary>
1010
public class TeamMember
1111
{
12+
/// <summary>
13+
/// A direct link to a user of this TeamMember
14+
/// </summary>
15+
public string Url => User.Url;
16+
1217
/// <summary>
1318
/// The ID of the team this team member is a member of
1419
/// </summary>

Modrinth.RestClient/Modrinth.RestClient.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,10 @@ public class ModrinthQueryBuilder : QueryStringBuilder
9999
/// <returns></returns>
100100
public override string Build(QueryStringBuilderInfo info)
101101
{
102-
if (!info.QueryParams.Any())
103-
{
104-
return string.Empty;
105-
}
106-
107-
var query = GetKeyValues(info.QueryParams);
108-
109-
return BuildTheQueryString(query);
102+
return !info.QueryParams.Any() ?
103+
string.Empty
104+
:
105+
BuildTheQueryString(GetKeyValues(info.QueryParams));
110106
}
111107

112108
private static string BuildTheQueryString(IDictionary<string, IList<string>> queryParams)

Modrinth.RestClient/Modrinth.RestClient.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
<RepositoryUrl>https://github.com/Zechiax/Modrinth.RestClient</RepositoryUrl>
1010
<PackageTags>modrinth;api;labrinth;restease</PackageTags>
1111
<Authors>Zechiax</Authors>
12-
<PackageReleaseNotes>- Added URL properties to Project, User, SearchResult and extension to help create version URL</PackageReleaseNotes>
12+
<PackageReleaseNotes>- Added URL properties to Project, User, SearchResult, TeamMember and extension to help create version URL
13+
</PackageReleaseNotes>
1314
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1415
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1516
<PackageReadmeFile>README.md</PackageReadmeFile>
16-
<PackageVersion>2.5.0</PackageVersion>
17+
<PackageVersion>2.5.1</PackageVersion>
1718
</PropertyGroup>
1819

1920
<ItemGroup>

0 commit comments

Comments
 (0)