fix #967 !!ap fix, !!lq fix (it shows info in footer again)

This commit is contained in:
Kwoth
2017-01-14 18:25:08 +01:00
parent e4bcb5a713
commit 659ba913a1
3 changed files with 27 additions and 11 deletions

View File

@@ -140,9 +140,15 @@ namespace NadekoBot.Modules.Music.Classes
RemoveSongAt(index, true);
OnStarted(this, CurrentSong);
await CurrentSong.Play(audioClient, cancelToken);
OnCompleted(this, CurrentSong);
try
{
await CurrentSong.Play(audioClient, cancelToken);
}
catch(OperationCanceledException)
{
OnCompleted(this, CurrentSong);
}
if (RepeatPlaylist)
AddSong(CurrentSong, CurrentSong.QueuerName);
@@ -151,7 +157,6 @@ namespace NadekoBot.Modules.Music.Classes
AddSong(CurrentSong, 0);
}
catch (OperationCanceledException) { }
catch (Exception ex)
{
Console.WriteLine("Music thread almost crashed.");

View File

@@ -192,7 +192,7 @@ namespace NadekoBot.Modules.Music
int startAt = itemsPerPage * (curPage - 1);
var number = 0 + startAt;
var embed = new EmbedBuilder()
.WithAuthor(eab => eab.WithName($"Player Queue")
.WithAuthor(eab => eab.WithName($"Player Queue - Page {curPage}/{lastPage + 1}")
.WithMusicIcon())
.WithDescription(string.Join("\n", musicPlayer.Playlist
.Skip(startAt)
@@ -217,7 +217,7 @@ namespace NadekoBot.Modules.Music
}
return embed;
};
await Context.Channel.SendPaginatedConfirmAsync(page, printAction, lastPage).ConfigureAwait(false);
await Context.Channel.SendPaginatedConfirmAsync(page, printAction, lastPage, false).ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]
@@ -814,7 +814,7 @@ namespace NadekoBot.Modules.Music
.WithFooter(ef => ef.WithText(song.PrettyInfo)))
.ConfigureAwait(false);
if (mp.Autoplay && mp.Playlist.Count == 0 && song.SongInfo.Provider == "YouTube")
if (mp.Autoplay && mp.Playlist.Count == 0 && song.SongInfo.ProviderType == MusicType.Normal)
{
await QueueSong(await queuer.Guild.GetCurrentUserAsync(), textCh, voiceCh, (await NadekoBot.Google.GetRelatedVideosAsync(song.SongInfo.Query, 4)).ToList().Shuffle().FirstOrDefault(), silent, musicType).ConfigureAwait(false);
}