Пример #1
0
        public PlayerMedia(StatusResponse response, Uri endpoint)
        {
            if (response == null)
            {
                throw new ArgumentNullException(nameof(response));
            }

            ImageUri = response.Image != null?BluParser.ParseAbsoluteUri(response.Image, endpoint) : null;

            ServiceIconUri = response.ServiceIcon != null?BluParser.ParseAbsoluteUri(response.ServiceIcon, endpoint) : null;

            Titles = new[] { response.Title1, response.Title2, response.Title3 }.Where(element => element != null).ToArray();
        }
Пример #2
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);
        }
Пример #3
0
 public PlayerPreset(PresetsResponse.Preset response, Uri endpoint)
 {
     Number   = response.ID;
     Name     = response.Name;
     ImageUri = BluParser.ParseAbsoluteUri(response.Image, endpoint);
 }