aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.WebDashboard/ApiClient.js
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.WebDashboard/ApiClient.js')
-rw-r--r--MediaBrowser.WebDashboard/ApiClient.js48
1 files changed, 47 insertions, 1 deletions
diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js
index 5ac4ecd8f..f56d3744b 100644
--- a/MediaBrowser.WebDashboard/ApiClient.js
+++ b/MediaBrowser.WebDashboard/ApiClient.js
@@ -1498,7 +1498,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
};
/**
- * Gets items based on a query, typicall for children of a folder
+ * Gets items based on a query, typically for children of a folder
* @param {String} userId
* @param {Object} options
* Options accepts the following properties:
@@ -1530,6 +1530,52 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
};
/**
+ Gets genres from an item
+ */
+ self.getGenres = function (userId, options) {
+
+ if (!userId) {
+ throw new Error("null userId");
+ }
+
+ var parentId = options.parentId || "root";
+
+ // Don't put these on the query string
+ delete options.parentId;
+
+ var url = self.getUrl("Users/" + userId + "/Items/" + parentId + "/Genres", options);
+
+ return self.ajax({
+ type: "GET",
+ url: url,
+ dataType: "json"
+ });
+ };
+
+ /**
+ Gets studios from an item
+ */
+ self.getStudios = function (userId, options) {
+
+ if (!userId) {
+ throw new Error("null userId");
+ }
+
+ var parentId = options.parentId || "root";
+
+ // Don't put these on the query string
+ delete options.parentId;
+
+ var url = self.getUrl("Users/" + userId + "/Items/" + parentId + "/Studios", options);
+
+ return self.ajax({
+ type: "GET",
+ url: url,
+ dataType: "json"
+ });
+ };
+
+ /**
* Gets local trailers for an item
*/
self.getLocalTrailers = function (userId, itemId) {