Skip to content

Commit 0807c29

Browse files
committed
make SDK CI-buildable and NuGet-ready on ubuntu-latest
1 parent 685d503 commit 0807c29

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/FastPix/Models/Components/EventTime.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public class EventTimeConverter : JsonConverter
9898
if (json == "null") {
9999
return null;
100100
}
101-
if (json[0] == '"' && json[^1] == '"'){
101+
if (json[0] == '"' && json[json.Length - 1] == '"'){
102102
return new EventTime(EventTimeType.Str) {
103-
Str = json[1..^1]
103+
Str = json.Substring(1, json.Length - 2)
104104
};
105105
}
106106
try {

src/FastPix/Models/Components/PlayerHeight.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public class PlayerHeightConverter : JsonConverter
9898
if (json == "null") {
9999
return null;
100100
}
101-
if (json[0] == '"' && json[^1] == '"'){
101+
if (json[0] == '"' && json[json.Length - 1] == '"'){
102102
return new PlayerHeight(PlayerHeightType.Str) {
103-
Str = json[1..^1]
103+
Str = json.Substring(1, json.Length - 2)
104104
};
105105
}
106106
try {

src/FastPix/Models/Components/PlayerWidth.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public class PlayerWidthConverter : JsonConverter
9898
if (json == "null") {
9999
return null;
100100
}
101-
if (json[0] == '"' && json[^1] == '"'){
101+
if (json[0] == '"' && json[json.Length - 1] == '"'){
102102
return new PlayerWidth(PlayerWidthType.Str) {
103-
Str = json[1..^1]
103+
Str = json.Substring(1, json.Length - 2)
104104
};
105105
}
106106
try {

src/FastPix/Models/Requests/ErrorCode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public class ErrorCodeConverter : JsonConverter
9898
if (json == "null") {
9999
return null;
100100
}
101-
if (json[0] == '"' && json[^1] == '"'){
101+
if (json[0] == '"' && json[json.Length - 1] == '"'){
102102
return new ErrorCode(ErrorCodeType.Str) {
103-
Str = json[1..^1]
103+
Str = json.Substring(1, json.Length - 2)
104104
};
105105
}
106106
try {

src/FastPix/Utils/FastPixMetadata.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ private Dictionary<string, string> GetMetadata()
175175

176176
metadata = new Dictionary<string, string>();
177177

178-
var groups = Value.Split(" ");
178+
var groups = Value.Split(' ');
179179

180180
foreach (var group in groups)
181181
{
182-
var parts = group.Split(":");
182+
var parts = group.Split(':');
183183

184184
if (parts.Length != 2)
185185
{
@@ -196,11 +196,11 @@ private void ParseMetadata<T>(string raw, ref T metadata)
196196
{
197197
Dictionary<string, string> values = new Dictionary<string, string>();
198198

199-
var groups = raw.Split(",");
199+
var groups = raw.Split(',');
200200

201201
foreach (var group in groups)
202202
{
203-
var parts = group.Split("=");
203+
var parts = group.Split('=');
204204
var val = "";
205205
if (parts.Length == 2)
206206
{

src/FastPix/Utils/Utilities.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ private static string StripSurroundingQuotes(string input)
171171
Regex surroundingQuotesRegex = new Regex("^\"(.*)\"$");
172172
var match = surroundingQuotesRegex.Match(input);
173173
// TODO: code review, this was modified due to compiler error with the use of values
174-
if (match.Groups.Count() == 2)
174+
if (match.Groups.Count == 2)
175175
{
176-
return match.Groups.Last().ToString();
176+
return match.Groups[1].Value;
177177
}
178178
return input;
179179
}

0 commit comments

Comments
 (0)