Cleaned up PR
This commit is contained in:
parent
d08abbafd0
commit
67a6b69088
@ -47,25 +47,7 @@ namespace NadekoBot.Modules.Music.Classes
|
|||||||
|
|
||||||
public string PrettyFullTime => PrettyCurrentTime + " / " + PrettyTotalTime;
|
public string PrettyFullTime => PrettyCurrentTime + " / " + PrettyTotalTime;
|
||||||
|
|
||||||
//public string PrettyName => $"**[{SongInfo.Title.TrimTo(70)}]({SongInfo.Query})**";
|
public string PrettyName => $"**[{SongInfo.Title.TrimTo(65)}]({songUrl})**";
|
||||||
|
|
||||||
public string PrettyName {
|
|
||||||
get {
|
|
||||||
switch (SongInfo.ProviderType)
|
|
||||||
{
|
|
||||||
case MusicType.Normal:
|
|
||||||
return $"**[{SongInfo.Title.TrimTo(70)}]({SongInfo.Query})**";
|
|
||||||
case MusicType.Soundcloud:
|
|
||||||
return $"**[{SongInfo.Title.TrimTo(70)}]({SongInfo.Query})**";
|
|
||||||
case MusicType.Local:
|
|
||||||
return $"**{SongInfo.Title.TrimTo(70)}**";
|
|
||||||
case MusicType.Radio:
|
|
||||||
return $"**{SongInfo.Title.TrimTo(70)}**";
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string PrettyInfo => $"{PrettyTotalTime} | {PrettyProvider} | {QueuerName}";
|
public string PrettyInfo => $"{PrettyTotalTime} | {PrettyProvider} | {QueuerName}";
|
||||||
|
|
||||||
@ -86,25 +68,24 @@ namespace NadekoBot.Modules.Music.Classes
|
|||||||
|
|
||||||
public string Thumbnail {
|
public string Thumbnail {
|
||||||
get {
|
get {
|
||||||
switch (SongInfo.Provider)
|
switch (SongInfo.ProviderType)
|
||||||
{
|
{
|
||||||
case "YouTube":
|
case MusicType.Radio:
|
||||||
//todo have videoid in songinfo from the start
|
//todo have videoid in songinfo from the start
|
||||||
var videoId = Regex.Match(SongInfo.Query, "<=v=[a-zA-Z0-9-]+(?=&)|(?<=[0-9])[^&\n]+|(?<=v=)[^&\n]+");
|
var videoId = Regex.Match(SongInfo.Query, "<=v=[a-zA-Z0-9-]+(?=&)|(?<=[0-9])[^&\n]+|(?<=v=)[^&\n]+");
|
||||||
return $"https://img.youtube.com/vi/{ videoId }/0.jpg";
|
return $"https://img.youtube.com/vi/{ videoId }/0.jpg";
|
||||||
case "SoundCloud":
|
case MusicType.Normal:
|
||||||
return SongInfo.AlbumArt;
|
|
||||||
case "Local File":
|
|
||||||
return $"https://cdn.discordapp.com/attachments/155726317222887425/261850914783100928/1482522077_music.png"; //test links
|
|
||||||
case "Radio Stream":
|
|
||||||
return $"https://cdn.discordapp.com/attachments/155726317222887425/261850925063340032/1482522097_radio.png"; //test links
|
return $"https://cdn.discordapp.com/attachments/155726317222887425/261850925063340032/1482522097_radio.png"; //test links
|
||||||
default:
|
case MusicType.Local:
|
||||||
|
return $"https://cdn.discordapp.com/attachments/155726317222887425/261850914783100928/1482522077_music.png"; //test links
|
||||||
|
case MusicType.Soundcloud:
|
||||||
|
return SongInfo.AlbumArt;
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string songURL {
|
private string songUrl {
|
||||||
get {
|
get {
|
||||||
switch (SongInfo.ProviderType)
|
switch (SongInfo.ProviderType)
|
||||||
{
|
{
|
||||||
|
@ -240,7 +240,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
.WithFooter(ef => ef.WithText($"{currentSong.PrettyProvider} | {currentSong.QueuerName}"))
|
.WithFooter(ef => ef.WithText($"{currentSong.PrettyProvider} | {currentSong.QueuerName}"))
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithThumbnail(tn => tn.Url = currentSong.Thumbnail)
|
.WithThumbnail(tn => tn.Url = currentSong.Thumbnail)
|
||||||
.WithUrl(currentSong.songURL);
|
.WithUrl(currentSong.SongUrl);
|
||||||
await channel.EmbedAsync(embed.Build()).ConfigureAwait(false);
|
await channel.EmbedAsync(embed.Build()).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user