2017-07-11 01:16:56 +00:00
|
|
|
|
using NadekoBot.Services.Database.Models;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2017-07-17 02:37:51 +00:00
|
|
|
|
namespace NadekoBot.Modules.Music.Common.SongResolver.Strategies
|
2017-07-11 01:16:56 +00:00
|
|
|
|
{
|
|
|
|
|
public class LocalSongResolveStrategy : IResolveStrategy
|
|
|
|
|
{
|
|
|
|
|
public Task<SongInfo> ResolveSong(string query)
|
|
|
|
|
{
|
|
|
|
|
return Task.FromResult(new SongInfo
|
|
|
|
|
{
|
|
|
|
|
Uri = () => Task.FromResult("\"" + Path.GetFullPath(query) + "\""),
|
|
|
|
|
Title = Path.GetFileNameWithoutExtension(query),
|
|
|
|
|
Provider = "Local File",
|
|
|
|
|
ProviderType = MusicType.Local,
|
|
|
|
|
Query = query,
|
|
|
|
|
Thumbnail = "https://cdn.discordapp.com/attachments/155726317222887425/261850914783100928/1482522077_music.png",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|