This commit is contained in:
samvaio 2016-12-29 19:18:57 +05:30 committed by GitHub
parent b57b35e826
commit b150bc9a85

View File

@ -58,7 +58,7 @@ namespace NadekoBot.Modules.Music.Classes
private string PrettyTotalTime { private string PrettyTotalTime {
get { get {
if (TotalTime == TimeSpan.Zero) if (TotalTime == TimeSpan.Zero)
return "-"; return "(?)";
else if (TotalTime == TimeSpan.MaxValue) else if (TotalTime == TimeSpan.MaxValue)
return "∞"; return "∞";
else else
@ -68,18 +68,17 @@ namespace NadekoBot.Modules.Music.Classes
public string Thumbnail { public string Thumbnail {
get { get {
switch (SongInfo.Provider) switch (SongInfo.ProviderType)
{ {
case MusicType.Radio:
case "YouTube": return $"https://cdn.discordapp.com/attachments/155726317222887425/261850925063340032/1482522097_radio.png"; //test links
case MusicType.Normal:
//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 "Radio Stream": case MusicType.Local:
return $"https://cdn.discordapp.com/attachments/155726317222887425/261850925063340032/1482522097_radio.png"; //test links
case "Local File":
return $"https://cdn.discordapp.com/attachments/155726317222887425/261850914783100928/1482522077_music.png"; //test links return $"https://cdn.discordapp.com/attachments/155726317222887425/261850914783100928/1482522077_music.png"; //test links
case "SoundCloud": case MusicType.Soundcloud:
return SongInfo.AlbumArt; return SongInfo.AlbumArt;
default: default:
return ""; return "";