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 PrettyName => $"**[{SongInfo.Title.TrimTo(70)}]({SongInfo.Query})**";
|
||||
|
||||
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 PrettyName => $"**[{SongInfo.Title.TrimTo(65)}]({songUrl})**";
|
||||
|
||||
public string PrettyInfo => $"{PrettyTotalTime} | {PrettyProvider} | {QueuerName}";
|
||||
|
||||
@ -86,25 +68,24 @@ namespace NadekoBot.Modules.Music.Classes
|
||||
|
||||
public string Thumbnail {
|
||||
get {
|
||||
switch (SongInfo.Provider)
|
||||
switch (SongInfo.ProviderType)
|
||||
{
|
||||
case "YouTube":
|
||||
case MusicType.Radio:
|
||||
//todo have videoid in songinfo from the start
|
||||
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";
|
||||
case "SoundCloud":
|
||||
return SongInfo.AlbumArt;
|
||||
case "Local File":
|
||||
return $"https://cdn.discordapp.com/attachments/155726317222887425/261850914783100928/1482522077_music.png"; //test links
|
||||
case "Radio Stream":
|
||||
case MusicType.Normal:
|
||||
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 "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string songURL {
|
||||
private string songUrl {
|
||||
get {
|
||||
switch (SongInfo.ProviderType)
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ namespace NadekoBot.Modules.Music
|
||||
.WithFooter(ef => ef.WithText($"{currentSong.PrettyProvider} | {currentSong.QueuerName}"))
|
||||
.WithOkColor()
|
||||
.WithThumbnail(tn => tn.Url = currentSong.Thumbnail)
|
||||
.WithUrl(currentSong.songURL);
|
||||
.WithUrl(currentSong.SongUrl);
|
||||
await channel.EmbedAsync(embed.Build()).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user