Beispiel #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>
        /// <param name="installed"> </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, object installed = 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));
            }
            if (installed != null)
            {
                var jpropinstalled = JToken.FromObject(installed, _client.Serializer);
                jArgs.Add(new JProperty("installed", jpropinstalled));
            }
            return(await _client.GetData <KodiRpc.Addons.GetAddonsResponse>("Addons.GetAddons", jArgs));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #6
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));
        }
Beispiel #7
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));
        }
Beispiel #8
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));
        }