Small pagination bugfix

This commit is contained in:
Master Kwoth
2017-10-17 16:10:51 +02:00
parent 88f92cbec6
commit e54ceba0ab
14 changed files with 28 additions and 30 deletions

View File

@ -258,7 +258,6 @@ namespace NadekoBot.Modules.Music
total.Minutes,
total.Seconds);
var maxPlaytime = mp.MaxPlaytimeSeconds;
var lastPage = songs.Length / itemsPerPage;
Func<int, EmbedBuilder> printAction = curPage =>
{
var startAt = itemsPerPage * curPage;
@ -300,7 +299,7 @@ namespace NadekoBot.Modules.Music
desc = add + "\n" + desc;
var embed = new EmbedBuilder()
.WithAuthor(eab => eab.WithName(GetText("player_queue", curPage + 1, lastPage + 1))
.WithAuthor(eab => eab.WithName(GetText("player_queue", curPage + 1, (songs.Length / itemsPerPage) + 1))
.WithMusicIcon())
.WithDescription(desc)
.WithFooter(ef => ef.WithText($"{mp.PrettyVolume} | {songs.Length} " +
@ -309,7 +308,8 @@ namespace NadekoBot.Modules.Music
return embed;
};
await Context.Channel.SendPaginatedConfirmAsync(_client, page, printAction, lastPage, false).ConfigureAwait(false);
await Context.Channel.SendPaginatedConfirmAsync(_client,
page, printAction, songs.Length, itemsPerPage, false).ConfigureAwait(false);
}
[NadekoCommand, Usage, Description, Aliases]