Esempio n. 1
0
        /// <summary>
        /// Handles the response and returns an item DTO or null if none is found
        /// </summary>
        /// <param name="response">MPD response</param>
        /// <returns>item DTO with metadata</returns>
        public IItem HandleResponse(IMpdResponse response)
        {
            if (!response.HasContent)
            {
                return(null);
            }

            var parser = new ResponseParser(response);

            return(parser.GetListedTracks().ToList().FirstOrDefault());
        }
Esempio n. 2
0
        public virtual IQueue HandleResponse(IMpdResponse response)
        {
            if (!response.HasContent)
            {
                return(null);
            }

            var parser = new ResponseParser(response);

            return(new Mpd.Queue
            {
                Items = parser.GetListedTracks()
            });
        }
Esempio n. 3
0
        public virtual IPlaylist HandleResponse(IMpdResponse response)
        {
            if (response.IsErrorResponse)
            {
                return(null);
            }

            var parser = new ResponseParser(response);

            return(new Mpd.Playlist
            {
                Name = PlaylistName,
                LastModified = parser.GetLastModified(),
                Items = parser.GetListedTracks()
            });
        }
        public IEnumerable <IItem> HandleResponse(IMpdResponse response)
        {
            var parser = new ResponseParser(response);

            return(parser.GetListedTracks());
        }