Пример #1
0
        /// <summary>
        /// Retrieves the program of a specific channel
        /// </summary>
        public async Task <XBMCRPC.PVR.GetBroadcastsResponse> GetBroadcasts(int channelid = 0, XBMCRPC.PVR.Fields.Broadcast properties = null, XBMCRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (channelid != null)
            {
                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));
            }
            if (limits != null)
            {
                var jproplimits = JToken.FromObject(limits, _client.Serializer);
                jArgs.Add(new JProperty("limits", jproplimits));
            }
            return(await _client.GetData <XBMCRPC.PVR.GetBroadcastsResponse>("PVR.GetBroadcasts", jArgs));
        }
Пример #2
0
        /// <summary>
        /// Retrieves the details of a specific broadcast
        /// </summary>
        public async Task <XBMCRPC.PVR.GetBroadcastDetailsResponse> GetBroadcastDetails(int broadcastid = 0, XBMCRPC.PVR.Fields.Broadcast properties = null)
        {
            var jArgs = new JObject();

            if (broadcastid != null)
            {
                var jpropbroadcastid = JToken.FromObject(broadcastid, _client.Serializer);
                jArgs.Add(new JProperty("broadcastid", jpropbroadcastid));
            }
            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            return(await _client.GetData <XBMCRPC.PVR.GetBroadcastDetailsResponse>("PVR.GetBroadcastDetails", jArgs));
        }