1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2024-09-16 05:30:09 +00:00
MpcNET/LibMpc/Commands/Commands.Reflection.cs

49 lines
1.4 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using System.Linq;
namespace LibMpc
2016-12-02 12:26:01 +00:00
{
public partial class Commands
{
/// <summary>
/// https://www.musicpd.org/doc/protocol/reflection_commands.html
/// </summary>
public static class Reflection
{
// TODO: config
2016-12-20 10:19:26 +00:00
/// <summary>
/// Shows which commands the current user has access to.
/// </summary>
public class Commands : IMpcCommand<IEnumerable<string>>
{
public string Value => "commands";
public IEnumerable<string> FormatResponse(IList<KeyValuePair<string, string>> response)
{
var result = response.Where(item => item.Key.Equals("command")).Select(item => item.Value);
return result;
}
}
2016-12-02 12:26:01 +00:00
// TODO: notcommands
public class TagTypes : IMpcCommand<IEnumerable<string>>
2016-12-02 12:26:01 +00:00
{
public string Value => "tagtypes";
public IEnumerable<string> FormatResponse(IList<KeyValuePair<string, string>> response)
2016-12-02 12:26:01 +00:00
{
var result = response.Where(item => item.Key.Equals("tagtype")).Select(item => item.Value);
return result;
2016-12-02 12:26:01 +00:00
}
}
// TODO: urlhandlers
// TODO: decoders
}
}
}