Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7604f7af88 | ||
![]() |
22e2318843 | ||
![]() |
6e2f05c9b8 | ||
![]() |
c9c5a4f892 | ||
![]() |
2b9986a7fa | ||
![]() |
f7f0c90570 |
@@ -4,11 +4,9 @@ using TomatenMusic_Api.Auth.Services;
|
|||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
// Add services to the container.
|
|
||||||
|
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddCors();
|
builder.Services.AddCors();
|
||||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
builder.Services.AddSwaggerGen();
|
builder.Services.AddSwaggerGen();
|
||||||
|
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Debug",
|
||||||
"Microsoft.AspNetCore": "Information"
|
"Microsoft.AspNetCore": "Debug"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -206,14 +206,14 @@ namespace TomatenMusic.Commands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (response.isPlaylist)
|
if (response.isPlaylist)
|
||||||
{
|
{
|
||||||
LavalinkPlaylist playlist = response.Playlist;
|
LavalinkPlaylist playlist = response.Playlist;
|
||||||
await player.PlayPlaylistAsync(playlist);
|
await player.PlayPlaylistAsync(playlist);
|
||||||
|
|
||||||
_ = ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Now Playing:").AddEmbed(
|
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Now Playing:").AddEmbed(
|
||||||
Common.AsEmbed(playlist)
|
Common.AsEmbed(playlist)
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ namespace TomatenMusic.Commands
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await ctx.EditResponseAsync(new DiscordWebhookBuilder()
|
await ctx.EditResponseAsync(new DiscordWebhookBuilder()
|
||||||
.WithContent($"❌ An error occured while playing your Track: ``{ex.Message}``")
|
.WithContent($"❌ An error occured while playing your Track: ``{ex.Message}``, ```{ex.StackTrace}```")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,6 @@ namespace TomatenMusic.Music.Entitites
|
|||||||
context.SpotifyIdentifier = spotifyIdentifier;
|
context.SpotifyIdentifier = spotifyIdentifier;
|
||||||
context.YoutubeUri = new Uri($"https://youtu.be/{track.TrackIdentifier}");
|
context.YoutubeUri = new Uri($"https://youtu.be/{track.TrackIdentifier}");
|
||||||
track.Context = context;
|
track.Context = context;
|
||||||
Console.WriteLine(context);
|
|
||||||
await youtubeService.PopulateTrackInfoAsync(track);
|
await youtubeService.PopulateTrackInfoAsync(track);
|
||||||
await spotifyService.PopulateTrackAsync(track);
|
await spotifyService.PopulateTrackAsync(track);
|
||||||
|
|
||||||
|
@@ -4,6 +4,8 @@ using System.Text;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Google.Apis.YouTube.v3.Data;
|
using Google.Apis.YouTube.v3.Data;
|
||||||
using Lavalink4NET.Player;
|
using Lavalink4NET.Player;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using TomatenMusic.Services;
|
||||||
|
|
||||||
namespace TomatenMusic.Music.Entitites
|
namespace TomatenMusic.Music.Entitites
|
||||||
{
|
{
|
||||||
@@ -28,11 +30,12 @@ namespace TomatenMusic.Music.Entitites
|
|||||||
|
|
||||||
public YoutubePlaylist(string name, IEnumerable<LavalinkTrack> tracks, Uri uri)
|
public YoutubePlaylist(string name, IEnumerable<LavalinkTrack> tracks, Uri uri)
|
||||||
{
|
{
|
||||||
Identifier = uri.ToString().Replace("https://www.youtube.com/playlist?list=", "");
|
Identifier = uri.ToString().Replace("https://www.youtube.com/playlist?list=", "").Replace("https://youtube.com/playlist?list=", "");
|
||||||
Name = name;
|
Name = name;
|
||||||
Tracks = tracks;
|
Tracks = tracks;
|
||||||
Url = uri;
|
Url = uri;
|
||||||
TrackCount = tracks.Count();
|
TrackCount = tracks.Count();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,8 +40,10 @@ namespace TomatenMusic.Music
|
|||||||
{
|
{
|
||||||
return Task.Run(() =>
|
return Task.Run(() =>
|
||||||
{
|
{
|
||||||
if (CurrentPlaylist == null)
|
if (CurrentPlaylist == null && Queue.Count == 0)
|
||||||
CurrentPlaylist = playlist;
|
CurrentPlaylist = playlist;
|
||||||
|
else
|
||||||
|
CurrentPlaylist = null;
|
||||||
|
|
||||||
_logger.LogInformation("Queued Playlist {0}", playlist.Name);
|
_logger.LogInformation("Queued Playlist {0}", playlist.Name);
|
||||||
foreach (LavalinkTrack track in playlist.Tracks)
|
foreach (LavalinkTrack track in playlist.Tracks)
|
||||||
|
@@ -269,7 +269,10 @@ namespace TomatenMusic.Prompt.Implementation
|
|||||||
|
|
||||||
protected async override Task<DiscordMessageBuilder> GetMessageAsync()
|
protected async override Task<DiscordMessageBuilder> GetMessageAsync()
|
||||||
{
|
{
|
||||||
return new DiscordMessageBuilder().AddEmbed(Common.GetQueueEmbed(Player)).AddEmbed(await Common.CurrentSongEmbedAsync(Player)).AddEmbeds(Embeds);
|
return new DiscordMessageBuilder()
|
||||||
|
.AddEmbed(Common.GetQueueEmbed(Player))
|
||||||
|
.AddEmbed(await Common.CurrentSongEmbedAsync(Player))
|
||||||
|
.AddEmbeds(Embeds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -70,7 +70,7 @@ namespace TomatenMusic.Services
|
|||||||
|
|
||||||
if (track == null) throw new ArgumentException("This Spotify Track was not found on Youtube");
|
if (track == null) throw new ArgumentException("This Spotify Track was not found on Youtube");
|
||||||
|
|
||||||
tracks.Add(await FullTrackContext.PopulateAsync(track, sTrack.Uri));
|
tracks.Add(await FullTrackContext.PopulateAsync(track, sTrack.Uri.Replace("spotify:track:", "")));
|
||||||
}
|
}
|
||||||
Uri uri;
|
Uri uri;
|
||||||
Uri.TryCreate(url, UriKind.Absolute, out uri);
|
Uri.TryCreate(url, UriKind.Absolute, out uri);
|
||||||
@@ -98,7 +98,7 @@ namespace TomatenMusic.Services
|
|||||||
|
|
||||||
if (track == null) throw new ArgumentException("This Spotify Track was not found on Youtube");
|
if (track == null) throw new ArgumentException("This Spotify Track was not found on Youtube");
|
||||||
|
|
||||||
tracks.Add(await FullTrackContext.PopulateAsync(track, fullTrack.Uri));
|
tracks.Add(await FullTrackContext.PopulateAsync(track, fullTrack.Uri.Replace("spotify:track:", "")));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -115,23 +115,35 @@ namespace TomatenMusic.Services
|
|||||||
public async Task<SpotifyPlaylist> PopulateSpotifyPlaylistAsync(SpotifyPlaylist playlist)
|
public async Task<SpotifyPlaylist> PopulateSpotifyPlaylistAsync(SpotifyPlaylist playlist)
|
||||||
{
|
{
|
||||||
var list = await this.Playlists.Get(playlist.Identifier);
|
var list = await this.Playlists.Get(playlist.Identifier);
|
||||||
playlist.Description = list.Description;
|
string desc = list.Description;
|
||||||
playlist.AuthorUri = new Uri(list.Owner.Uri);
|
|
||||||
|
playlist.Description = desc.Substring(0, Math.Min(desc.Length, 1024)) + (desc.Length > 1020 ? "..." : " ");
|
||||||
|
if (playlist.Description.Length < 2)
|
||||||
|
playlist.Description = "None";
|
||||||
|
|
||||||
|
playlist.AuthorUri = new Uri($"https://open.spotify.com/user/{list.Owner.Id}");
|
||||||
playlist.AuthorName = list.Owner.DisplayName;
|
playlist.AuthorName = list.Owner.DisplayName;
|
||||||
playlist.Followers = list.Followers.Total;
|
playlist.Followers = list.Followers.Total;
|
||||||
playlist.Url = new Uri(list.Uri);
|
playlist.Url = new Uri($"https://open.spotify.com/playlist/{playlist.Identifier}");
|
||||||
playlist.AuthorThumbnail = new Uri(list.Owner.Images.First().Url);
|
try
|
||||||
|
{
|
||||||
|
playlist.AuthorThumbnail = new Uri(list.Owner.Images.First().Url);
|
||||||
|
}
|
||||||
|
catch (Exception ex) { }
|
||||||
|
|
||||||
return playlist;
|
return playlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<SpotifyPlaylist> PopulateSpotifyAlbumAsync(SpotifyPlaylist playlist)
|
public async Task<SpotifyPlaylist> PopulateSpotifyAlbumAsync(SpotifyPlaylist playlist)
|
||||||
{
|
{
|
||||||
var list = await this.Albums.Get(playlist.Identifier);
|
var list = await this.Albums.Get(playlist.Identifier);
|
||||||
playlist.Description = list.Label;
|
string desc = list.Label;
|
||||||
playlist.AuthorUri = new Uri(list.Artists.First().Uri);
|
|
||||||
|
playlist.Description = desc.Substring(0, Math.Min(desc.Length, 1024)) + (desc.Length > 1020 ? "..." : " ");
|
||||||
|
playlist.AuthorUri = new Uri($"https://open.spotify.com/user/{list.Artists.First().Uri}");
|
||||||
playlist.AuthorName = list.Artists.First().Name;
|
playlist.AuthorName = list.Artists.First().Name;
|
||||||
playlist.Followers = list.Popularity;
|
playlist.Followers = list.Popularity;
|
||||||
playlist.Url = new Uri(list.Uri);
|
playlist.Url = new Uri($"https://open.spotify.com/album/{playlist.Identifier}");
|
||||||
|
|
||||||
return playlist;
|
return playlist;
|
||||||
}
|
}
|
||||||
@@ -147,7 +159,7 @@ namespace TomatenMusic.Services
|
|||||||
context.SpotifyAlbum = spotifyTrack.Album;
|
context.SpotifyAlbum = spotifyTrack.Album;
|
||||||
context.SpotifyArtists = spotifyTrack.Artists;
|
context.SpotifyArtists = spotifyTrack.Artists;
|
||||||
context.SpotifyPopularity = spotifyTrack.Popularity;
|
context.SpotifyPopularity = spotifyTrack.Popularity;
|
||||||
context.SpotifyUri = new Uri(spotifyTrack.Uri);
|
context.SpotifyUri = new Uri($"https://open.spotify.com/track/{context.SpotifyIdentifier}");
|
||||||
track.Context = context;
|
track.Context = context;
|
||||||
|
|
||||||
return track;
|
return track;
|
||||||
|
@@ -14,11 +14,13 @@ namespace TomatenMusic.Music
|
|||||||
{
|
{
|
||||||
public ISpotifyService _spotifyService { get; set; }
|
public ISpotifyService _spotifyService { get; set; }
|
||||||
public IAudioService _audioService { get; set; }
|
public IAudioService _audioService { get; set; }
|
||||||
|
public YoutubeService _youtubeService { get; set; }
|
||||||
|
|
||||||
public TrackProvider(ISpotifyService spotify, IAudioService audioService)
|
public TrackProvider(ISpotifyService spotify, IAudioService audioService, YoutubeService youtubeService)
|
||||||
{
|
{
|
||||||
_audioService = audioService;
|
_audioService = audioService;
|
||||||
_spotifyService = spotify;
|
_spotifyService = spotify;
|
||||||
|
_youtubeService = youtubeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<MusicActionResponse> SearchAsync(string query, bool withSearchResults = false)
|
public async Task<MusicActionResponse> SearchAsync(string query, bool withSearchResults = false)
|
||||||
@@ -55,7 +57,7 @@ namespace TomatenMusic.Music
|
|||||||
|
|
||||||
if (loadResult.LoadType == TrackLoadType.PlaylistLoaded && !isSearch)
|
if (loadResult.LoadType == TrackLoadType.PlaylistLoaded && !isSearch)
|
||||||
return new MusicActionResponse(
|
return new MusicActionResponse(
|
||||||
playlist: new YoutubePlaylist(loadResult.PlaylistInfo.Name, await FullTrackContext.PopulateTracksAsync(loadResult.Tracks), uri));
|
playlist: await _youtubeService.PopulatePlaylistAsync(new YoutubePlaylist(loadResult.PlaylistInfo.Name, await FullTrackContext.PopulateTracksAsync(loadResult.Tracks), uri)));
|
||||||
else
|
else
|
||||||
return new MusicActionResponse(await FullTrackContext.PopulateAsync(loadResult.Tracks.First()));
|
return new MusicActionResponse(await FullTrackContext.PopulateAsync(loadResult.Tracks.First()));
|
||||||
|
|
||||||
|
@@ -39,7 +39,9 @@ namespace TomatenMusic.Services
|
|||||||
context.YoutubeAuthorSubs = (ulong) channel.Statistics.SubscriberCount;
|
context.YoutubeAuthorSubs = (ulong) channel.Statistics.SubscriberCount;
|
||||||
context.YoutubeAuthorThumbnail = new Uri(channel.Snippet.Thumbnails.High.Url);
|
context.YoutubeAuthorThumbnail = new Uri(channel.Snippet.Thumbnails.High.Url);
|
||||||
context.YoutubeAuthorUri = new Uri($"https://www.youtube.com/channel/{channel.Id}");
|
context.YoutubeAuthorUri = new Uri($"https://www.youtube.com/channel/{channel.Id}");
|
||||||
context.YoutubeDescription = video.Snippet.Description;
|
string desc = video.Snippet.Description;
|
||||||
|
|
||||||
|
context.YoutubeDescription = desc.Substring(0, Math.Min(desc.Length, 1024)) + (desc.Length > 1020 ? "..." : " ");
|
||||||
if (video.Statistics.LikeCount != null)
|
if (video.Statistics.LikeCount != null)
|
||||||
context.YoutubeLikes = (ulong) video.Statistics.LikeCount;
|
context.YoutubeLikes = (ulong) video.Statistics.LikeCount;
|
||||||
context.YoutubeTags = video.Snippet.Tags;
|
context.YoutubeTags = video.Snippet.Tags;
|
||||||
@@ -51,7 +53,7 @@ namespace TomatenMusic.Services
|
|||||||
return track;
|
return track;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<LavalinkTrack>> PopulateMultiTrackListAsync(IEnumerable<LavalinkTrack> tracks)
|
public async Task<List<LavalinkTrack>> PopulateTrackListAsync(IEnumerable<LavalinkTrack> tracks)
|
||||||
{
|
{
|
||||||
List<LavalinkTrack> newTracks = new List<LavalinkTrack>();
|
List<LavalinkTrack> newTracks = new List<LavalinkTrack>();
|
||||||
foreach (var track in tracks)
|
foreach (var track in tracks)
|
||||||
@@ -66,12 +68,15 @@ namespace TomatenMusic.Services
|
|||||||
|
|
||||||
string desc = list.Snippet.Description;
|
string desc = list.Snippet.Description;
|
||||||
|
|
||||||
playlist.Description = desc.Substring(0, Math.Min(desc.Length, 4092)) + (desc.Length > 4092 ? "..." : " ");
|
playlist.Description = desc.Substring(0, Math.Min(desc.Length, 1024)) + (desc.Length > 1020 ? "..." : " ");
|
||||||
|
if (playlist.Description.Length < 2)
|
||||||
|
playlist.Description = "None";
|
||||||
|
|
||||||
playlist.Thumbnail = new Uri(list.Snippet.Thumbnails.High.Url);
|
playlist.Thumbnail = new Uri(list.Snippet.Thumbnails.High.Url);
|
||||||
playlist.CreationTime = (DateTime)list.Snippet.PublishedAt;
|
playlist.CreationTime = (DateTime)list.Snippet.PublishedAt;
|
||||||
playlist.YoutubeItem = list;
|
playlist.YoutubeItem = list;
|
||||||
playlist.AuthorThumbnail = new Uri(channel.Snippet.Thumbnails.High.Url);
|
playlist.AuthorThumbnail = new Uri(channel.Snippet.Thumbnails.High.Url);
|
||||||
playlist.AuthorUri = new Uri($"https://www.youtube.com/playlist?list={playlist.Identifier}");
|
playlist.AuthorUri = new Uri($"https://www.youtube.com/channels/{channel.Id}");
|
||||||
|
|
||||||
return playlist;
|
return playlist;
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,6 @@ using Microsoft.Extensions.Logging;
|
|||||||
using DSharpPlus;
|
using DSharpPlus;
|
||||||
using DSharpPlus.EventArgs;
|
using DSharpPlus.EventArgs;
|
||||||
using DSharpPlus.Entities;
|
using DSharpPlus.Entities;
|
||||||
using DSharpPlus.Net;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using DSharpPlus.SlashCommands;
|
using DSharpPlus.SlashCommands;
|
||||||
using DSharpPlus.SlashCommands.EventArgs;
|
using DSharpPlus.SlashCommands.EventArgs;
|
||||||
@@ -77,7 +76,6 @@ namespace TomatenMusic
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Lavalink
|
|
||||||
.AddSingleton<IDiscordClientWrapper, DiscordShardedClientWrapper>()
|
.AddSingleton<IDiscordClientWrapper, DiscordShardedClientWrapper>()
|
||||||
.AddSingleton<IAudioService, LavalinkNode>()
|
.AddSingleton<IAudioService, LavalinkNode>()
|
||||||
.AddSingleton(new InactivityTrackingOptions
|
.AddSingleton(new InactivityTrackingOptions
|
||||||
@@ -188,7 +186,7 @@ namespace TomatenMusic
|
|||||||
if (e.Exception is NotFoundException)
|
if (e.Exception is NotFoundException)
|
||||||
logger.LogDebug($"{ ((NotFoundException)e.Exception).JsonMessage }");
|
logger.LogDebug($"{ ((NotFoundException)e.Exception).JsonMessage }");
|
||||||
if (e.Exception is BadRequestException)
|
if (e.Exception is BadRequestException)
|
||||||
logger.LogDebug($"{ ((BadRequestException)e.Exception).JsonMessage }");
|
logger.LogInformation($"{ ((BadRequestException)e.Exception).Errors }");
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -100,32 +100,36 @@ namespace TomatenMusic.Util
|
|||||||
if (playlist is YoutubePlaylist)
|
if (playlist is YoutubePlaylist)
|
||||||
{
|
{
|
||||||
YoutubePlaylist youtubePlaylist = (YoutubePlaylist)playlist;
|
YoutubePlaylist youtubePlaylist = (YoutubePlaylist)playlist;
|
||||||
builder
|
|
||||||
.WithAuthor(playlist.AuthorName, playlist.AuthorUri.ToString(), youtubePlaylist.AuthorThumbnail.ToString())
|
builder.WithAuthor(playlist.AuthorName, playlist.AuthorUri.ToString(), youtubePlaylist.AuthorThumbnail.ToString());
|
||||||
.WithTitle(playlist.Name)
|
builder.WithTitle(playlist.Name);
|
||||||
.WithUrl(playlist.Url)
|
builder.WithUrl(playlist.Url);
|
||||||
.WithDescription(playlist.Description)
|
builder.WithDescription(TrackListString(playlist.Tracks));
|
||||||
.WithImageUrl(youtubePlaylist.Thumbnail)
|
builder.WithImageUrl(youtubePlaylist.Thumbnail);
|
||||||
.AddField("Tracks", TrackListString(playlist.Tracks), false)
|
builder.AddField("Description", playlist.Description, false);
|
||||||
.AddField("Track Count", $"{playlist.Tracks.Count()} Tracks", true)
|
builder.AddField("Track Count", $"{playlist.Tracks.Count()} Tracks", true);
|
||||||
.AddField("Length", $"{Common.GetTimestamp(playlist.GetLength())}", true)
|
builder.AddField("Length", $"{Common.GetTimestamp(playlist.GetLength())}", true);
|
||||||
.AddField("Create Date", $"{youtubePlaylist.CreationTime:dd. MMMM, yyyy}", true);
|
builder.AddField("Create Date", $"{youtubePlaylist.CreationTime:dd. MMMM, yyyy}", true);
|
||||||
|
|
||||||
}else if (playlist is SpotifyPlaylist)
|
}else if (playlist is SpotifyPlaylist)
|
||||||
{
|
{
|
||||||
SpotifyPlaylist spotifyPlaylist = (SpotifyPlaylist)playlist;
|
SpotifyPlaylist spotifyPlaylist = (SpotifyPlaylist)playlist;
|
||||||
builder
|
|
||||||
.WithAuthor(playlist.AuthorName, playlist.AuthorUri.ToString(), spotifyPlaylist.AuthorThumbnail.ToString())
|
builder.WithTitle(playlist.Name);
|
||||||
.WithTitle(playlist.Name)
|
builder.WithUrl(playlist.Url);
|
||||||
.WithUrl(playlist.Url)
|
builder.WithDescription(TrackListString(playlist.Tracks));
|
||||||
.WithDescription(playlist.Description)
|
builder.AddField("Description", playlist.Description, false);
|
||||||
.AddField("Tracks", TrackListString(playlist.Tracks), false)
|
builder.AddField("Track Count", $"{playlist.Tracks.Count()} Tracks", true);
|
||||||
.AddField("Track Count", $"{playlist.Tracks.Count()} Tracks", true)
|
builder.AddField("Length", $"{Common.GetTimestamp(playlist.GetLength())}", true);
|
||||||
.AddField("Length", $"{Common.GetTimestamp(playlist.GetLength())}", true)
|
builder.AddField("Spotify Followers", $"{spotifyPlaylist.Followers:N0}", true);
|
||||||
.AddField("Spotify Followers", $"{spotifyPlaylist.Followers:N0}", true);
|
if (spotifyPlaylist.AuthorThumbnail != null)
|
||||||
|
{
|
||||||
|
builder.WithAuthor(playlist.AuthorName, playlist.AuthorUri.ToString(), spotifyPlaylist.AuthorThumbnail.ToString());
|
||||||
|
}else
|
||||||
|
builder.WithAuthor(playlist.AuthorName, playlist.AuthorUri.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder;
|
return builder.Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DiscordEmbed GetQueueEmbed(GuildPlayer player)
|
public static DiscordEmbed GetQueueEmbed(GuildPlayer player)
|
||||||
@@ -146,11 +150,12 @@ namespace TomatenMusic.Util
|
|||||||
builder.AddField("Length", GetTimestamp(timeSpan), true);
|
builder.AddField("Length", GetTimestamp(timeSpan), true);
|
||||||
builder.AddField("Loop Type", player.PlayerQueue.LoopType.ToString(), true);
|
builder.AddField("Loop Type", player.PlayerQueue.LoopType.ToString(), true);
|
||||||
builder.AddField("Autoplay", player.Autoplay ? "✅" : "❌", true);
|
builder.AddField("Autoplay", player.Autoplay ? "✅" : "❌", true);
|
||||||
if (player.PlayerQueue.PlayedTracks.Any())
|
|
||||||
builder.AddField("History", TrackListString(player.PlayerQueue.PlayedTracks), true);
|
|
||||||
if (player.PlayerQueue.CurrentPlaylist != null)
|
if (player.PlayerQueue.CurrentPlaylist != null)
|
||||||
builder.AddField("Current Playlist", $"[{player.PlayerQueue.CurrentPlaylist.Name}]({player.PlayerQueue.CurrentPlaylist.Url})", true);
|
builder.AddField("Current Playlist", $"[{player.PlayerQueue.CurrentPlaylist.Name}]({player.PlayerQueue.CurrentPlaylist.Url})", true);
|
||||||
|
|
||||||
|
if (player.PlayerQueue.PlayedTracks.Any())
|
||||||
|
builder.AddField("History", TrackListString(player.PlayerQueue.PlayedTracks), true);
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,9 +166,9 @@ namespace TomatenMusic.Util
|
|||||||
foreach (LavalinkTrack track in tracks)
|
foreach (LavalinkTrack track in tracks)
|
||||||
{
|
{
|
||||||
FullTrackContext context = (FullTrackContext)track.Context;
|
FullTrackContext context = (FullTrackContext)track.Context;
|
||||||
if (count > 15)
|
if (count > 10)
|
||||||
{
|
{
|
||||||
builder.Append(String.Format("***And {0} more...***", tracks.Count() - 15));
|
builder.Append(String.Format("***And {0} more...***", tracks.Count() - 10));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user