From 5369f8d64ae0f86272cc450982cb7f689763c723 Mon Sep 17 00:00:00 2001 From: "J.D. Purcell" Date: Fri, 6 Oct 2017 15:23:17 -0400 Subject: [PATCH] Minor changes. --- RechatTool/Rechat.cs | 4 ++-- RechatTool/RechatTool.csproj | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RechatTool/Rechat.cs b/RechatTool/Rechat.cs index 207c338..36a1b70 100644 --- a/RechatTool/Rechat.cs +++ b/RechatTool/Rechat.cs @@ -31,7 +31,7 @@ public static void DownloadFile(long videoId, string path, bool overwrite = fals progressCallback?.Invoke(segments.Count); } while (nextCursor != null); - JArray combined = new JArray(segments.SelectMany(s => s).ToArray()); + JArray combined = new JArray(segments.SelectMany(s => s)); File.WriteAllText(path, combined.ToString(Formatting.None), new UTF8Encoding(true)); } @@ -51,7 +51,7 @@ private static void AddTwitchApiHeaders(HttpWebRequest request) { public static void ProcessFile(string pathIn, string pathOut = null, bool overwrite = false) { if (pathOut == null) { - bool isAlreadyTxt = Path.GetExtension(pathIn).Equals(".txt", StringComparison.OrdinalIgnoreCase); + bool isAlreadyTxt = pathIn.EndsWith(".txt", StringComparison.OrdinalIgnoreCase); pathOut = Path.Combine( Path.GetDirectoryName(pathIn), Path.GetFileNameWithoutExtension(pathIn) + (isAlreadyTxt ? "-p" : "") + ".txt"); diff --git a/RechatTool/RechatTool.csproj b/RechatTool/RechatTool.csproj index 03850a9..96c5d23 100644 --- a/RechatTool/RechatTool.csproj +++ b/RechatTool/RechatTool.csproj @@ -21,6 +21,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -30,6 +31,7 @@ TRACE prompt 4 + false