/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
public GetDirectoryResponse GetDirectory(string directory = null, XBMCRPC.Files.Media media = 0, XBMCRPC.List.Fields.Files properties = null, XBMCRPC.List.Sort sort = 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)); } var jRet = _client.GetData <GetDirectoryResponse>("Files.GetDirectory", jArgs); return(jRet); }