2017-07-17 04:37:51 +02:00
|
|
|
|
using NadekoBot.Modules.Music.Common;
|
|
|
|
|
using NadekoBot.Services.Database.Models;
|
2017-07-11 03:16:56 +02:00
|
|
|
|
using NadekoBot.Services.Impl;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2017-07-17 04:37:51 +02:00
|
|
|
|
namespace NadekoBot.Modules.Music.Extensions
|
2017-07-11 03:16:56 +02: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)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|