Exemplo n.º 1
0
        /// <summary>
        /// Gets all available addons
        /// </summary>
        /// <param name="type"> </param>
        /// <param name="content"> Content provided by the addon. Only considered for plugins and scripts.</param>
        /// <param name="properties"> </param>
        /// <param name="limits"> </param>
        /// <returns>KODIRPC.Addons.GetAddonsResponse</returns>
        public async Task <KODIRPC.Addons.GetAddonsResponse> GetAddons(KODIRPC.Addon.Types?type = null, KODIRPC.Addon.Content?content = null, KODIRPC.Addon.Fields properties = null, KODIRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (type != null)
            {
                var jproptype = JToken.FromObject(type, _client.Serializer);
                jArgs.Add(new JProperty("type", jproptype));
            }
            if (content != null)
            {
                var jpropcontent = JToken.FromObject(content, _client.Serializer);
                jArgs.Add(new JProperty("content", jpropcontent));
            }
            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.Addons.GetAddonsResponse>("Addons.GetAddons", jArgs));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves the timers
        /// </summary>
        /// <param name="properties"> </param>
        /// <param name="limits"> </param>
        /// <returns>KODIRPC.PVR.GetTimersResponse</returns>
        public async Task <KODIRPC.PVR.GetTimersResponse> GetTimers(KODIRPC.PVR.Fields.Timer 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.GetTimersResponse>("PVR.GetTimers", jArgs));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Retrieves the program of a specific channel
        /// </summary>
        /// <param name="channelid"> REQUIRED </param>
        /// <param name="properties"> </param>
        /// <param name="limits"> </param>
        /// <returns>KODIRPC.PVR.GetBroadcastsResponse</returns>
        public async Task <KODIRPC.PVR.GetBroadcastsResponse> GetBroadcasts(int?channelid = null, KODIRPC.PVR.Fields.Broadcast properties = null, KODIRPC.List.Limits limits = 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));
            }
            if (limits != null)
            {
                var jproplimits = JToken.FromObject(limits, _client.Serializer);
                jArgs.Add(new JProperty("limits", jproplimits));
            }
            return(await _client.GetData <KODIRPC.PVR.GetBroadcastsResponse>("PVR.GetBroadcasts", jArgs));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Retrieves the channel groups for the specified type
        /// </summary>
        /// <param name="channeltype"> REQUIRED </param>
        /// <param name="limits"> </param>
        /// <returns>KODIRPC.PVR.GetChannelGroupsResponse</returns>
        public async Task <KODIRPC.PVR.GetChannelGroupsResponse> GetChannelGroups(KODIRPC.PVR.Channel.Type?channeltype = null, KODIRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (channeltype == null)
            {
                throw new global::System.ArgumentException("Parameter cannot be null channeltype");
            }
            else
            {
                var jpropchanneltype = JToken.FromObject(channeltype, _client.Serializer);
                jArgs.Add(new JProperty("channeltype", jpropchanneltype));
            }
            if (limits != null)
            {
                var jproplimits = JToken.FromObject(limits, _client.Serializer);
                jArgs.Add(new JProperty("limits", jproplimits));
            }
            return(await _client.GetData <KODIRPC.PVR.GetChannelGroupsResponse>("PVR.GetChannelGroups", jArgs));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Retrieve all profiles
        /// </summary>
        /// <param name="properties"> </param>
        /// <param name="limits"> </param>
        /// <param name="sort"> </param>
        /// <returns>KODIRPC.Profiles.GetProfilesResponse</returns>
        public async Task <KODIRPC.Profiles.GetProfilesResponse> GetProfiles(KODIRPC.Profiles.Fields.Profile properties = null, KODIRPC.List.Limits limits = null, KODIRPC.List.Sort sort = 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));
            }
            if (sort != null)
            {
                var jpropsort = JToken.FromObject(sort, _client.Serializer);
                jArgs.Add(new JProperty("sort", jpropsort));
            }
            return(await _client.GetData <KODIRPC.Profiles.GetProfilesResponse>("Profiles.GetProfiles", jArgs));
        }
Exemplo n.º 6
0
        /// <summary>
        /// Get all items from playlist
        /// </summary>
        /// <param name="playlistid"> REQUIRED </param>
        /// <param name="properties"> </param>
        /// <param name="limits"> </param>
        /// <param name="sort"> </param>
        /// <returns>KODIRPC.Playlist.GetItemsResponse</returns>
        public async Task <KODIRPC.Playlist.GetItemsResponse> GetItems(int?playlistid = null, KODIRPC.List.Fields.All properties = null, KODIRPC.List.Limits limits = null, KODIRPC.List.Sort sort = null)
        {
            var jArgs = new JObject();

            if (playlistid == null)
            {
                throw new global::System.ArgumentException("Parameter cannot be null playlistid");
            }
            else
            {
                var jpropplaylistid = JToken.FromObject(playlistid, _client.Serializer);
                jArgs.Add(new JProperty("playlistid", jpropplaylistid));
            }
            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));
            }
            if (sort != null)
            {
                var jpropsort = JToken.FromObject(sort, _client.Serializer);
                jArgs.Add(new JProperty("sort", jpropsort));
            }
            return(await _client.GetData <KODIRPC.Playlist.GetItemsResponse>("Playlist.GetItems", jArgs));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Get the directories and files in the given directory
        /// </summary>
        /// <param name="directory"> REQUIRED </param>
        /// <param name="media"> </param>
        /// <param name="properties"> </param>
        /// <param name="sort"> </param>
        /// <param name="limits"> Limits are applied after getting the directory content thus retrieval is not faster when they are applied.</param>
        /// <returns>KODIRPC.Files.GetDirectoryResponse</returns>
        public async Task <KODIRPC.Files.GetDirectoryResponse> GetDirectory(string directory = null, KODIRPC.Files.Media?media = null, KODIRPC.List.Fields.Files properties = null, KODIRPC.List.Sort sort = null, KODIRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (directory == null)
            {
                throw new global::System.ArgumentException("Parameter cannot be null directory");
            }
            else
            {
                var jpropdirectory = JToken.FromObject(directory, _client.Serializer);
                jArgs.Add(new JProperty("directory", jpropdirectory));
            }
            if (media != null)
            {
                var jpropmedia = JToken.FromObject(media, _client.Serializer);
                jArgs.Add(new JProperty("media", jpropmedia));
            }
            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            if (sort != null)
            {
                var jpropsort = JToken.FromObject(sort, _client.Serializer);
                jArgs.Add(new JProperty("sort", jpropsort));
            }
            if (limits != null)
            {
                var jproplimits = JToken.FromObject(limits, _client.Serializer);
                jArgs.Add(new JProperty("limits", jproplimits));
            }
            return(await _client.GetData <KODIRPC.Files.GetDirectoryResponse>("Files.GetDirectory", jArgs));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Get the sources of the media windows
        /// </summary>
        /// <param name="media"> REQUIRED </param>
        /// <param name="limits"> </param>
        /// <param name="sort"> </param>
        /// <returns>KODIRPC.Files.GetSourcesResponse</returns>
        public async Task <KODIRPC.Files.GetSourcesResponse> GetSources(KODIRPC.Files.Media?media = null, KODIRPC.List.Limits limits = null, KODIRPC.List.Sort sort = null)
        {
            var jArgs = new JObject();

            if (media == null)
            {
                throw new global::System.ArgumentException("Parameter cannot be null media");
            }
            else
            {
                var jpropmedia = JToken.FromObject(media, _client.Serializer);
                jArgs.Add(new JProperty("media", jpropmedia));
            }
            if (limits != null)
            {
                var jproplimits = JToken.FromObject(limits, _client.Serializer);
                jArgs.Add(new JProperty("limits", jproplimits));
            }
            if (sort != null)
            {
                var jpropsort = JToken.FromObject(sort, _client.Serializer);
                jArgs.Add(new JProperty("sort", jpropsort));
            }
            return(await _client.GetData <KODIRPC.Files.GetSourcesResponse>("Files.GetSources", jArgs));
        }