Songs Thumbnail fixed

This commit is contained in:
samvaio 2016-12-28 21:43:38 +05:30
parent 9cd81f4e39
commit a7fc482ff7

View File

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