diff --git a/.gitignore b/.gitignore index 9f57582f..31a88a35 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ Tests/ !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config +NadekoBot/bin/Debug/data/nadekobot.sqlite diff --git a/NadekoBot/Classes/Music/Song.cs b/NadekoBot/Classes/Music/Song.cs index 5e5172d2..e4600322 100644 --- a/NadekoBot/Classes/Music/Song.cs +++ b/NadekoBot/Classes/Music/Song.cs @@ -142,6 +142,8 @@ namespace NadekoBot.Classes.Music { Arguments = $"-i {SongInfo.Uri} -f s16le -ar 48000 -ac 2 pipe:1 -loglevel quiet", UseShellExecute = false, RedirectStandardOutput = true, + RedirectStandardError = false, + CreateNoWindow = true, }); int blockSize = 3840; byte[] buffer = new byte[blockSize]; @@ -163,6 +165,8 @@ namespace NadekoBot.Classes.Music { finally { if (p != null) { p.CancelOutputRead(); + p.StandardOutput.Dispose(); + p.CloseMainWindow(); p.Close(); p.Dispose(); } @@ -178,7 +182,7 @@ namespace NadekoBot.Classes.Music { while (!prebufferingComplete && bufferAttempts++ < toAttemptTimes) { await Task.Delay(waitPerAttempt); } - Console.WriteLine($"Prebuffering done? in {waitPerAttempt*bufferAttempts}"); + Console.WriteLine($"Prebuffering done? in {waitPerAttempt * bufferAttempts}"); int blockSize = 3840; byte[] buffer = new byte[blockSize]; int attempt = 0; diff --git a/NadekoBot/Classes/NadekoStats.cs b/NadekoBot/Classes/NadekoStats.cs index b980149e..5f63f060 100644 --- a/NadekoBot/Classes/NadekoStats.cs +++ b/NadekoBot/Classes/NadekoStats.cs @@ -108,13 +108,15 @@ namespace NadekoBot { sb.Append($" | TextChannels: {TextChannelsCount}"); sb.AppendLine($" | VoiceChannels: {VoiceChannelsCount}`"); //$"\nUsers: {_client.Servers.SelectMany(x => x.Users.Select(y => y.Id)).Count()} (non-unique)" + - sb.AppendLine($"`Heap: {Math.Round((double)GC.GetTotalMemory(false) / 1.MiB(), 2).ToString()} MB`"); + //sb.AppendLine($"`Heap: {} MB`"); sb.AppendLine($"`Commands Ran this session: {_commandsRan}`"); sb.AppendLine($"`Message queue size:{_client.MessageQueue.Count}`"); sb.AppendLine($"`Greeted {Commands.ServerGreetCommand.Greeted} times.`"); _statsCache = sb.ToString(); }); + public string Heap() => Math.Round((double)GC.GetTotalMemory(true) / 1.MiB(), 2).ToString(); + public async Task GetStats() { if (_statsSW.Elapsed.Seconds > 5) { await LoadStats(); diff --git a/NadekoBot/bin/Debug/data/nadekobot.sqlite b/NadekoBot/bin/Debug/data/nadekobot.sqlite deleted file mode 100644 index a956a5a4..00000000 Binary files a/NadekoBot/bin/Debug/data/nadekobot.sqlite and /dev/null differ