Example #1
0
        /// <summary>
        /// Retrieves the channel list
        /// </summary>
        /// <param name="properties"> </param>
        /// <param name="limits"> </param>
        /// <returns>KodiRpc.PVR.GetChannelsResponse</returns>
        public async Task <KodiRpc.PVR.GetChannelsResponse> GetChannels(KodiRpc.PVR.Fields.Channel properties = null, KodiRpc.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            if (limits != null)
            {
                var jproplimits = JToken.FromObject(limits, _client.Serializer);
                jArgs.Add(new JProperty("limits", jproplimits));
            }
            return(await _client.GetData <KodiRpc.PVR.GetChannelsResponse>("PVR.GetChannels", jArgs));
        }
Example #2
0
        /// <summary>
        /// Retrieves the details of a specific channel
        /// </summary>
        /// <param name="channelid"> REQUIRED </param>
        /// <param name="properties"> </param>
        /// <returns>KodiRpc.PVR.GetChannelDetailsResponse</returns>
        public async Task <KodiRpc.PVR.GetChannelDetailsResponse> GetChannelDetails(int?channelid = null, KodiRpc.PVR.Fields.Channel properties = null)
        {
            var jArgs = new JObject();

            if (channelid == null)
            {
                throw new global::System.ArgumentException("Parameter cannot be null channelid");
            }
            else
            {
                var jpropchannelid = JToken.FromObject(channelid, _client.Serializer);
                jArgs.Add(new JProperty("channelid", jpropchannelid));
            }
            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            return(await _client.GetData <KodiRpc.PVR.GetChannelDetailsResponse>("PVR.GetChannelDetails", jArgs));
        }