mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-07-02 00:57:38 +00:00
Formatting output responsability of command.
Commands: disableoutput, enableoutput, outputs, tagtypes, update implemented.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace LibMpc
|
||||
{
|
||||
@ -13,13 +14,18 @@ namespace LibMpc
|
||||
// TODO: commands
|
||||
// TODO: notcommands
|
||||
|
||||
public class TagTypes : IMpcCommand<string>
|
||||
public class TagTypes : IMpcCommand<IList<string>>
|
||||
{
|
||||
public string Value => "tagtypes";
|
||||
|
||||
public IReadOnlyDictionary<string, IList<string>> FormatResponse(IReadOnlyDictionary<string, IList<string>> response)
|
||||
IDictionary<string, IList<string>> IMpcCommand<IList<string>>.FormatResponse(IList<KeyValuePair<string, string>> response)
|
||||
{
|
||||
return response;
|
||||
var result = new Dictionary<string, IList<string>>
|
||||
{
|
||||
{ "tagtypes", response.Where(item => item.Key.Equals("tagtype")).Select(item => item.Value).ToList() }
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user