using System.Collections.Generic; using System.Linq; using LibMpc.Types; namespace LibMpc { public partial class Commands { public static class Playlists { /// /// https://www.musicpd.org/doc/protocol/queue.html /// public static class Current { } /// /// https://www.musicpd.org/doc/protocol/playlist_files.html /// public static class Stored { /// /// Prints a list of the playlist directory. /// public class ListPlaylists : IMpcCommand> { public string Value => "listplaylists"; public IEnumerable FormatResponse(IList> response) { var result = new List(); foreach (var line in response) { if (line.Key.Equals("playlist")) { result.Add(new MpdPlaylist(line.Value)); } else if (line.Key.Equals("Last-Modified")) { result.Last().AddLastModified(line.Value); } } return result; } } } } } }