Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves the channel list
        /// </summary>
        public async Task <XBMCRPC.PVR.GetChannelsResponse> GetChannels(int channelgroupid, XBMCRPC.PVR.Fields.Channel properties = null, XBMCRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (channelgroupid != null)
            {
                var jpropchannelgroupid = JToken.FromObject(channelgroupid, _client.Serializer);
                jArgs.Add(new JProperty("channelgroupid", jpropchannelgroupid));
            }
            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.GetChannelsResponse>("PVR.GetChannels", jArgs));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get all items from playlist
        /// </summary>
        public async Task <XBMCRPC.Playlist.GetItemsResponse> GetItems(int playlistid = 0, XBMCRPC.List.Fields.All properties = null, XBMCRPC.List.Limits limits = null, XBMCRPC.List.Sort sort = null)
        {
            var jArgs = new JObject();

            if (playlistid != null)
            {
                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 <XBMCRPC.Playlist.GetItemsResponse>("Playlist.GetItems", jArgs));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Retrieves the channel groups for the specified type
        /// </summary>
        public async Task <XBMCRPC.PVR.GetChannelGroupsResponse> GetChannelGroups(XBMCRPC.PVR.Channel.Type channeltype = 0, XBMCRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (channeltype != null)
            {
                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 <XBMCRPC.PVR.GetChannelGroupsResponse>("PVR.GetChannelGroups", jArgs));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Get the sources of the media windows
        /// </summary>
        public async Task <XBMCRPC.Files.GetSourcesResponse> GetSources(XBMCRPC.Files.Media media = 0, XBMCRPC.List.Limits limits = null, XBMCRPC.List.Sort sort = null)
        {
            var jArgs = new JObject();

            if (media != null)
            {
                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 <XBMCRPC.Files.GetSourcesResponse>("Files.GetSources", jArgs));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Get the directories and files in the given directory
        /// </summary>
        public async Task <XBMCRPC.Files.GetDirectoryResponse> GetDirectory(string directory = null, XBMCRPC.Files.Media media = 0, XBMCRPC.List.Fields.Files properties = null, XBMCRPC.List.Sort sort = null, XBMCRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (directory != null)
            {
                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 <XBMCRPC.Files.GetDirectoryResponse>("Files.GetDirectory", jArgs));
        }
Ejemplo n.º 6
0
        public GetAddonsResponse GetAddons(XBMCRPC.Addon.Types type = 0, XBMCRPC.Addon.Content content = 0, XBMCRPC.Addon.Fields properties = null, XBMCRPC.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));
            }
            var jRet = _client.GetData <GetAddonsResponse>("Addons.GetAddons", jArgs);

            return(jRet);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Gets all available addons
        /// </summary>
        public async Task <XBMCRPC.Addons.GetAddonsResponse> GetAddons(XBMCRPC.Addons.GetAddons_enabled2 enabled, XBMCRPC.Addon.Types type = 0, XBMCRPC.Addon.Content content = 0, XBMCRPC.Addon.Fields properties = null, XBMCRPC.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 (enabled != null)
            {
                var jpropenabled = JToken.FromObject(enabled, _client.Serializer);
                jArgs.Add(new JProperty("enabled", jpropenabled));
            }
            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.Addons.GetAddonsResponse>("Addons.GetAddons", jArgs));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Retrieve all profiles
        /// </summary>
        public async Task <XBMCRPC.Profiles.GetProfilesResponse> GetProfiles(XBMCRPC.Profiles.Fields.Profile properties = null, XBMCRPC.List.Limits limits = null, XBMCRPC.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 <XBMCRPC.Profiles.GetProfilesResponse>("Profiles.GetProfiles", jArgs));
        }