1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2025-07-01 08:47:36 +00:00

ListPlaylist command implemeted + test.

This commit is contained in:
glucaci
2016-12-20 16:17:06 +01:00
parent 092240c22f
commit 982a013839
2 changed files with 33 additions and 0 deletions

View File

@ -21,6 +21,25 @@ namespace LibMpc
/// </summary>
public static class Stored
{
public class ListPlaylist : IMpcCommand<IEnumerable<IMpdFilePath>>
{
private readonly string _playlistName;
public ListPlaylist(string playlistName)
{
_playlistName = playlistName;
}
public string Value => string.Join(" ", "listplaylist", $"\"{_playlistName}\"");
public IEnumerable<IMpdFilePath> FormatResponse(IList<KeyValuePair<string, string>> response)
{
var results = response.Where(line => line.Key.Equals("file")).Select(line => new MpdFile(line.Value));
return results;
}
}
/// <summary>
/// Prints a list of the playlist directory.
/// </summary>