diff --git a/Songify Slim/Util/General/Logger.cs b/Songify Slim/Util/General/Logger.cs index d3ff9772..c9822b02 100644 --- a/Songify Slim/Util/General/Logger.cs +++ b/Songify Slim/Util/General/Logger.cs @@ -64,7 +64,22 @@ public static void LogExc(Exception exception) // ignored } } + public static void LogStr(string s) + { + AppendConsole(s); + // Writes a log file with exceptions in it + string logFile = GetLogFilePath(); + try + { + File.AppendAllText(logFile, DateTime.Now.ToString("HH:mm:ss") + @": " + s + Environment.NewLine); + //Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss") + @": " + s); + } + catch + { + // ignored + } + } private static void AppendConsole(string s) { if (s == null) return; @@ -148,21 +163,6 @@ private static Color GetForegroundColor(string s) return Colors.White; } - public static void LogStr(string s) - { - AppendConsole(s); - // Writes a log file with exceptions in it - string logFile = GetLogFilePath(); - try - { - File.AppendAllText(logFile, DateTime.Now.ToString("HH:mm:ss") + @": " + s + Environment.NewLine); - //Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss") + @": " + s); - } - catch - { - // ignored - } - } } } \ No newline at end of file diff --git a/Songify Slim/Util/Songify/TwitchHandler.cs b/Songify Slim/Util/Songify/TwitchHandler.cs index 7bfc7b77..44d05fb9 100644 --- a/Songify Slim/Util/Songify/TwitchHandler.cs +++ b/Songify Slim/Util/Songify/TwitchHandler.cs @@ -1754,9 +1754,11 @@ private static string CreateSuccessResponse(FullTrack track, string displayName) { string response = Settings.Settings.BotRespSuccess; string artists = ""; + string singleArtist = ""; try { artists = string.Join(", ", track.Artists.Select(o => o.Name).ToList()); + singleArtist = track.Artists.FirstOrDefault()?.Name; } catch (Exception e) { @@ -1766,7 +1768,7 @@ private static string CreateSuccessResponse(FullTrack track, string displayName) response = response.Replace("{user}", displayName); response = response.Replace("{artist}", artists); - response = response.Replace("{single_artist}", track.Artists.FirstOrDefault()?.Name); + response = response.Replace("{single_artist}", singleArtist); response = response.Replace("{title}", track.Name); response = response.Replace("{maxreq}", ""); response = response.Replace("{position}", $"{GlobalObjects.ReqList.Count}");