Even more epic improvements to music
This commit is contained in:
parent
54b6af2a19
commit
e87a56a79d
@ -75,6 +75,8 @@ namespace NadekoBot.Modules.Music.Classes
|
|||||||
|
|
||||||
private ConcurrentQueue<Action> actionQueue { get; set; } = new ConcurrentQueue<Action>();
|
private ConcurrentQueue<Action> actionQueue { get; set; } = new ConcurrentQueue<Action>();
|
||||||
|
|
||||||
|
public string PrettyVolume => $"🔉 {(int)(Volume * 100)}%";
|
||||||
|
|
||||||
public MusicPlayer(IVoiceChannel startingVoiceChannel, float? defaultVolume)
|
public MusicPlayer(IVoiceChannel startingVoiceChannel, float? defaultVolume)
|
||||||
{
|
{
|
||||||
if (startingVoiceChannel == null)
|
if (startingVoiceChannel == null)
|
||||||
|
@ -49,9 +49,9 @@ namespace NadekoBot.Modules.Music.Classes
|
|||||||
|
|
||||||
public string PrettyName => $"**[{SongInfo.Title.TrimTo(65)}]({songUrl})**";
|
public string PrettyName => $"**[{SongInfo.Title.TrimTo(65)}]({songUrl})**";
|
||||||
|
|
||||||
public string PrettyInfo => $"🔉 {(int)(MusicPlayer.Volume * 100)}% | {PrettyTotalTime} | {PrettyProvider} | {QueuerName}";
|
public string PrettyInfo => $"{MusicPlayer.PrettyVolume} | {PrettyTotalTime} | {PrettyProvider} | {QueuerName}";
|
||||||
|
|
||||||
public string PrettyFullName => $"{PrettyName}\n\t\t*{PrettyInfo}*";
|
public string PrettyFullName => $"{PrettyName}\n\t\t`{PrettyTotalTime} | {PrettyProvider} | {QueuerName}`";
|
||||||
|
|
||||||
public string PrettyCurrentTime => CurrentTime.ToString(@"mm\:ss");
|
public string PrettyCurrentTime => CurrentTime.ToString(@"mm\:ss");
|
||||||
|
|
||||||
|
@ -193,6 +193,8 @@ namespace NadekoBot.Modules.Music
|
|||||||
int startAt = itemsPerPage * (page - 1);
|
int startAt = itemsPerPage * (page - 1);
|
||||||
var number = 0 + startAt;
|
var number = 0 + startAt;
|
||||||
|
|
||||||
|
var total = musicPlayer.TotalPlaytime;
|
||||||
|
var maxPlaytime = musicPlayer.MaxPlaytimeSeconds;
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.WithAuthor(eab => eab.WithName($"Player Queue - Page {page}")
|
.WithAuthor(eab => eab.WithName($"Player Queue - Page {page}")
|
||||||
.WithMusicIcon())
|
.WithMusicIcon())
|
||||||
@ -200,7 +202,9 @@ namespace NadekoBot.Modules.Music
|
|||||||
.Skip(startAt)
|
.Skip(startAt)
|
||||||
.Take(10)
|
.Take(10)
|
||||||
.Select(v => $"`{++number}.` {v.PrettyFullName}")))
|
.Select(v => $"`{++number}.` {v.PrettyFullName}")))
|
||||||
.WithFooter(ef => ef.WithText($"{musicPlayer.Playlist.Count} tracks currently queued."))
|
.WithFooter(ef => ef.WithText($"{musicPlayer.PrettyVolume} | {musicPlayer.Playlist.Count} " +
|
||||||
|
$"{("tracks".SnPl(musicPlayer.Playlist.Count))} | {(int)total.TotalHours}h {total.Minutes}m {total.Seconds}s | " +
|
||||||
|
(musicPlayer.FairPlay? "✔️fairplay" : "✖️fairplay") + $" | " + (maxPlaytime == 0 ? "unlimited" : $"{maxPlaytime}s limit")))
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
|
||||||
if (musicPlayer.RepeatSong)
|
if (musicPlayer.RepeatSong)
|
||||||
@ -235,7 +239,8 @@ namespace NadekoBot.Modules.Music
|
|||||||
var embed = new EmbedBuilder().WithOkColor()
|
var embed = new EmbedBuilder().WithOkColor()
|
||||||
.WithAuthor(eab => eab.WithName("Now Playing").WithMusicIcon())
|
.WithAuthor(eab => eab.WithName("Now Playing").WithMusicIcon())
|
||||||
.WithDescription(currentSong.PrettyName)
|
.WithDescription(currentSong.PrettyName)
|
||||||
.WithFooter(ef => ef.WithText(currentSong.PrettyFullTime + $" | {currentSong.PrettyProvider} | {currentSong.QueuerName}"));
|
.WithThumbnail(tn => tn.Url = currentSong.Thumbnail)
|
||||||
|
.WithFooter(ef => ef.WithText(musicPlayer.PrettyVolume + " | " + currentSong.PrettyFullTime + $" | {currentSong.PrettyProvider} | {currentSong.QueuerName}"));
|
||||||
|
|
||||||
await channel.EmbedAsync(embed.Build()).ConfigureAwait(false);
|
await channel.EmbedAsync(embed.Build()).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@ -563,7 +568,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task SetMaxPlaytime(IUserMessage imsg, uint seconds)
|
public async Task SetMaxPlaytime(IUserMessage imsg, uint seconds)
|
||||||
{
|
{
|
||||||
if (seconds < 15)
|
if (seconds < 15 && seconds != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var channel = (ITextChannel)imsg.Channel;
|
var channel = (ITextChannel)imsg.Channel;
|
||||||
|
Loading…
Reference in New Issue
Block a user