public MusicContentNode(BluChannel channel, MusicContentNode parent, BrowseContentResponse response) { _channel = channel ?? throw new ArgumentNullException(nameof(channel)); Parent = parent; if (response == null) { throw new ArgumentNullException(nameof(response)); } _searchKey = response.SearchKey; ServiceName = response.ServiceName; Entries = response.Items != null?response.Items.Select(element => new MusicContentEntry(channel, this, element)).ToArray() : new MusicContentEntry[0]; }
public MusicContentEntry(BluChannel channel, MusicContentNode node, BrowseContentResponse.Item item) { _channel = channel ?? throw new ArgumentNullException(nameof(channel)); Node = node ?? throw new ArgumentNullException(nameof(node)); if (item == null) { throw new ArgumentNullException(nameof(item)); } _key = item.BrowseKey; Name = item.Text; Type = !string.IsNullOrEmpty(item.Type) ? item.Type.First().ToString().ToUpper() + item.Type.Substring(1) : null; ImageUri = BluParser.ParseAbsoluteUri(item.Image, channel.Endpoint); }