From f5b0407392a7c9462dc90019ff4411c5a8267496 Mon Sep 17 00:00:00 2001 From: samvaio Date: Fri, 23 Dec 2016 08:06:54 +0530 Subject: [PATCH] Reverted the revert --- src/NadekoBot/Modules/Music/Music.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/NadekoBot/Modules/Music/Music.cs b/src/NadekoBot/Modules/Music/Music.cs index 1d3e7fba..d1d7f7ff 100644 --- a/src/NadekoBot/Modules/Music/Music.cs +++ b/src/NadekoBot/Modules/Music/Music.cs @@ -15,7 +15,7 @@ using Newtonsoft.Json.Linq; using System.Collections.Generic; using NadekoBot.Services.Database.Models; using System.Text.RegularExpressions; -//using System.Threading; +using System.Threading; namespace NadekoBot.Modules.Music { @@ -326,7 +326,7 @@ namespace NadekoBot.Modules.Music var msg = await channel.SendMessageAsync($"🎵 Attempting to queue **{count}** songs".SnPl(count) + "...").ConfigureAwait(false); - /*var cancelSource = new CancellationTokenSource(); + var cancelSource = new CancellationTokenSource(); var tasks = Task.WhenAll(idArray.Select(async id => { @@ -340,9 +340,9 @@ namespace NadekoBot.Modules.Music catch { try { cancelSource.Cancel(); } catch { } } })); - await Task.WhenAny(tasks, Task.Delay(Timeout.Infinite, cancelSource.Token));*/ + await Task.WhenAny(tasks, Task.Delay(Timeout.Infinite, cancelSource.Token)); - foreach (var id in idArray) + /*foreach (var id in idArray) { try { @@ -350,7 +350,7 @@ namespace NadekoBot.Modules.Music } catch (SongNotFoundException) { } catch { break; } - } + }*/ await msg.ModifyAsync(m => m.Content = "✅ Playlist queue complete.").ConfigureAwait(false); } @@ -937,4 +937,4 @@ namespace NadekoBot.Modules.Music } } } -} \ No newline at end of file +}