NadekoBot/NadekoBot.Modules.Music/Extensions/Extensions.cs

24 lines
752 B
C#
Raw Normal View History

2017-07-17 02:37:51 +00:00
using NadekoBot.Modules.Music.Common;
using NadekoBot.Services.Database.Models;
2017-07-11 01:16:56 +00:00
using NadekoBot.Services.Impl;
using System;
using System.Threading.Tasks;
2017-07-17 02:37:51 +00:00
namespace NadekoBot.Modules.Music.Extensions
2017-07-11 01:16:56 +00:00
{
public static class Extensions
{
public static Task<SongInfo> GetSongInfo(this SoundCloudVideo svideo) =>
Task.FromResult(new SongInfo
{
Title = svideo.FullName,
Provider = "SoundCloud",
Uri = () => svideo.StreamLink(),
ProviderType = MusicType.Soundcloud,
Query = svideo.TrackLink,
Thumbnail = svideo.artwork_url,
TotalTime = TimeSpan.FromMilliseconds(svideo.Duration)
});
}
}