From c4fe43d69b848e1de99346a16dfe0f792b823241 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:44:38 -0400 Subject: [PATCH 1/2] Swap bitrate and file size columns --- TwitchDownloaderCLI/Modes/InfoHandler.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TwitchDownloaderCLI/Modes/InfoHandler.cs b/TwitchDownloaderCLI/Modes/InfoHandler.cs index f0e94f09..c1a818e7 100644 --- a/TwitchDownloaderCLI/Modes/InfoHandler.cs +++ b/TwitchDownloaderCLI/Modes/InfoHandler.cs @@ -141,8 +141,8 @@ private static void HandleVodTable(GqlVideoResponse videoInfo, GqlVideoChapterRe if (hasBitrate) { streamTable - .AddColumn(new TableColumn("File size").RightAligned()) - .AddColumn(new TableColumn("Bitrate").RightAligned()); + .AddColumn(new TableColumn("Bitrate").RightAligned()) + .AddColumn(new TableColumn("File size").RightAligned()); } foreach (var stream in m3u8.Streams) @@ -155,9 +155,9 @@ private static void HandleVodTable(GqlVideoResponse videoInfo, GqlVideoChapterRe if (hasBitrate) { var videoLength = TimeSpan.FromSeconds(videoInfo.data.video.lengthSeconds); - var fileSize = stream.StreamInfo.Bandwidth.StringifyOrDefault(x => $"~{VideoSizeEstimator.StringifyByteCount(VideoSizeEstimator.EstimateVideoSize(x, TimeSpan.Zero, videoLength))}", DEFAULT_STRING); var bitrate = stream.StreamInfo.Bandwidth.StringifyOrDefault(x => $"{x / 1000}kbps", DEFAULT_STRING); - streamTable.AddRow(name, resolution, fps, codecs, fileSize, bitrate); + var fileSize = stream.StreamInfo.Bandwidth.StringifyOrDefault(x => $"~{VideoSizeEstimator.StringifyByteCount(VideoSizeEstimator.EstimateVideoSize(x, TimeSpan.Zero, videoLength))}", DEFAULT_STRING); + streamTable.AddRow(name, resolution, fps, codecs, bitrate, fileSize); } else { From 361742756fa6134e16d2d907fe66ad90a252de41 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:46:14 -0400 Subject: [PATCH 2/2] Truncate values in FPS table columns --- TwitchDownloaderCLI/Modes/InfoHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TwitchDownloaderCLI/Modes/InfoHandler.cs b/TwitchDownloaderCLI/Modes/InfoHandler.cs index c1a818e7..7ddc3c5e 100644 --- a/TwitchDownloaderCLI/Modes/InfoHandler.cs +++ b/TwitchDownloaderCLI/Modes/InfoHandler.cs @@ -149,7 +149,7 @@ private static void HandleVodTable(GqlVideoResponse videoInfo, GqlVideoChapterRe { var name = stream.GetResolutionFramerateString(); var resolution = stream.StreamInfo.Resolution.StringifyOrDefault(x => x.ToString(), DEFAULT_STRING); - var fps = stream.StreamInfo.Framerate.StringifyOrDefault(x => x.ToString(CultureInfo.CurrentCulture), DEFAULT_STRING); + var fps = stream.StreamInfo.Framerate.StringifyOrDefault(x => $"{x:F0}", DEFAULT_STRING); var codecs = stream.StreamInfo.Codecs.StringifyOrDefault(x => x, DEFAULT_STRING); if (hasBitrate) @@ -303,7 +303,7 @@ private static void HandleClipTable(GqlClipResponse clipInfo, GqlClipTokenRespon { var name = string.Create(CultureInfo.CurrentCulture, $"{quality.quality}p{quality.frameRate:F0}"); var height = quality.quality; - var fps = quality.frameRate.StringifyOrDefault(x => string.Create(CultureInfo.CurrentCulture, $"{x:F2}"), DEFAULT_STRING); + var fps = quality.frameRate.StringifyOrDefault(x => $"{x:F0}", DEFAULT_STRING); qualityTable.AddRow(name, height, fps); }