Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when creating info table for VOD/clip with a name containing square brackets #1210

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions TwitchDownloaderCLI/Modes/InfoHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
private static void HandleVodRaw(GqlVideoResponse videoInfo, GqlVideoChapterResponse chapters, string playlistString)
{
var stdOut = Console.OpenStandardOutput();
JsonSerializer.Serialize(stdOut, videoInfo);

Check warning on line 101 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 101 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 101 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 101 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 101 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 101 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli-mac

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 101 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli-mac

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.
Console.WriteLine();
JsonSerializer.Serialize(stdOut, chapters);

Check warning on line 103 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 103 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 103 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 103 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 103 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 103 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli-mac

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 103 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli-mac

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.
Console.WriteLine();
Console.Write(playlistString);
}
Expand All @@ -120,7 +120,7 @@
.AddColumn(new TableColumn("Key"))
.AddColumn(new TableColumn("Value"))
.AddRow(new Markup("Streamer"), GetUserNameMarkup(infoVideo.owner.displayName, infoVideo.owner.login, DEFAULT_STRING))
.AddRow("Title", infoVideo.title)
.AddRow(new Markup("Title"), new Paragraph(infoVideo.title))
.AddRow("Length", StringifyTimestamp(TimeSpan.FromSeconds(infoVideo.lengthSeconds)))
.AddRow("Category", infoVideo.game?.displayName ?? DEFAULT_STRING)
.AddRow("Views", infoVideo.viewCount.ToString("N0", CultureInfo.CurrentCulture))
Expand Down Expand Up @@ -258,9 +258,9 @@
private static void HandleClipRaw(GqlClipResponse clipInfo, GqlClipTokenResponse clipQualities)
{
var stdOut = Console.OpenStandardOutput();
JsonSerializer.Serialize(stdOut, clipInfo);

Check warning on line 261 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 261 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 261 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 261 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 261 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 261 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli-mac

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 261 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli-mac

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.
Console.WriteLine();
JsonSerializer.Serialize(stdOut, clipQualities);

Check warning on line 263 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 263 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 263 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 263 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 263 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 263 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli-mac

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.

Check warning on line 263 in TwitchDownloaderCLI/Modes/InfoHandler.cs

View workflow job for this annotation

GitHub Actions / build-cli-mac

Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(Stream, TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.
}

private static void HandleClipTable(GqlClipResponse clipInfo, GqlClipTokenResponse clipQualities)
Expand All @@ -274,7 +274,7 @@
.AddColumn(new TableColumn("Key"))
.AddColumn(new TableColumn("Value"))
.AddRow(new Markup("Streamer"), GetUserNameMarkup(infoClip.broadcaster?.displayName, infoClip.broadcaster?.login, DEFAULT_STRING))
.AddRow("Title", infoClip.title)
.AddRow(new Markup("Title"), new Paragraph(infoClip.title))
.AddRow("Length", StringifyTimestamp(TimeSpan.FromSeconds(infoClip.durationSeconds)))
.AddRow(new Markup("Clipped by"), GetUserNameMarkup(infoClip.curator?.displayName, infoClip.curator?.login, DEFAULT_STRING))
.AddRow("Category", infoClip.game?.displayName ?? DEFAULT_STRING)
Expand Down
Loading