Skip to content

Commit 0c9ac11

Browse files
committed
use stringbuilder for latestparams too
1 parent 883641f commit 0c9ac11

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

FileListSharp/Builders/FileListLatestParams.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Dynamic;
1+
using System.Text;
22
using System.Text.RegularExpressions;
33

44
namespace FileListSharp.Builders;
@@ -11,13 +11,13 @@ public partial class FileListLatestParams
1111

1212
public override string ToString()
1313
{
14-
var final = "";
14+
var final = new StringBuilder();
1515

16-
if (_limit is not null) final += $"&limit={_limit}";
17-
if (_imdb is not null) final += $"&imdb={_imdb}";
18-
if (_category is not null) final += $"&category={string.Join(",", _category)}";
16+
if (_limit is not null) final.Append($"&limit={_limit}");
17+
if (_imdb is not null) final.Append($"&imdb={_imdb}");
18+
if (_category is not null) final.Append($"&category={string.Join(",", _category)}");
1919

20-
return final;
20+
return final.ToString();
2121
}
2222

2323
/// <summary>

FileListSharp/Builders/FileListSearchParams.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
using System.Diagnostics.CodeAnalysis;
21
using System.Text;
32
using System.Text.RegularExpressions;
43

54
namespace FileListSharp.Builders;
65

7-
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
6+
// ReSharper disable once ClassNeverInstantiated.Global
87
public partial class FileListSearchParams
98
{
109
private string _type = "name";
@@ -21,15 +20,15 @@ public override string ToString()
2120
{
2221
if (_query is null) throw new ArgumentNullException("Query", $"The query for {GetType().Name} cannot be null.");
2322
var final = new StringBuilder($"type={_type}&query={_query}");
24-
23+
2524
if (_category is not null) final.Append($"&category={string.Join(',', _category)}");
2625
if (_moderated is not null) final.Append($"&moderated={_moderated}");
2726
if (_internal is not null) final.Append($"&internal={_internal}");
2827
if (_freeleech is not null) final.Append($"&freeleech={_freeleech}");
2928
if (_doubleup is not null) final.Append($"&doubleup={_doubleup}");
3029
if (_season is not null) final.Append($"&season={_season}");
3130
if (_episode is not null) final.Append($"&episode={_episode}");
32-
31+
3332
return final.ToString();
3433
}
3534

@@ -100,7 +99,7 @@ public FileListSearchParams Categories(int[] categories)
10099
_category = categories;
101100
return this;
102101
}
103-
102+
104103
/// <summary>
105104
/// Whether the searched torrent should be moderated
106105
/// </summary>

FileListSharp/Builders/FileListTorrent.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Text.Json.Serialization;
2+
23
// ReSharper disable ClassNeverInstantiated.Global
34

45
namespace FileListSharp.Builders;

FileListSharp/FileListSharp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Text;
44
using System.Text.Json;
55
using System.Web;
6-
using FileListSharp.Builders;
6+
using FileListSharp.Builders;
77

88
namespace FileListSharp;
99

FileListSharp/FileListSharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<RepositoryUrl>https://github.com/alexthemaster/FileListSharp</RepositoryUrl>
1212
<PackageTags>tracker, filelist, torrent tracker, private torrent</PackageTags>
1313
<PackageReadmeFile>README.md</PackageReadmeFile>
14-
<Version>2.0.0</Version>
14+
<Version>2.0.1</Version>
1515
</PropertyGroup>
1616

1717
<ItemGroup>

0 commit comments

Comments
 (0)