fixed .play

This commit is contained in:
Master Kwoth 2017-07-02 16:20:25 +02:00
parent 45e4816033
commit b33e4bdd80
3 changed files with 4 additions and 3 deletions

View File

@ -125,7 +125,7 @@ namespace NadekoBot.Modules.Music
[RequireContext(ContextType.Guild)]
public Task Play([Remainder]string query = null)
{
if (string.IsNullOrWhiteSpace(query))
if (!string.IsNullOrWhiteSpace(query))
try { return Queue(query); } catch (QueueFullException) { return Task.CompletedTask; }
else
return Next();

View File

@ -232,7 +232,8 @@ namespace NadekoBot.Services.Music
lock (locker)
{
manualSkip = true;
Queue.Next(skipCount - 1);
// if player is stopped, and user uses .n, it should play current song.
// It's a bit weird, but that's the least annoying solution
Stopped = false;
Unpause();
CancelCurrentSong();

View File

@ -27,7 +27,7 @@ namespace NadekoBot.Services.Music
this.p = Process.Start(new ProcessStartInfo
{
FileName = "ffmpeg",
Arguments = $"-ss 0 -i {songUri} -f s16le -ar 48000 -vn -ac 2 pipe:1 -loglevel quiet",
Arguments = $"-i {songUri} -f s16le -ar 48000 -vn -ac 2 pipe:1 -loglevel quiet",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,