From c6fbb714c272aa5f78f1998fbcb14bc1c0edd0ff Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 17 Apr 2013 10:52:02 -0400 Subject: [PATCH] update to latest js api client --- MediaBrowser.WebDashboard/ApiClient.js | 66 +++++++++++++++++++++++ MediaBrowser.WebDashboard/packages.config | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index fe361a8685..420b75d93d 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -1828,6 +1828,72 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + /** + Gets a variety of item counts that a person appears in + */ + self.getPersonItemCounts = function (userId, name) { + + if (!userId) { + throw new Error("null userId"); + } + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Users/{UserId}/Persons/" + encodeName(name) + "/Counts"); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + + /** + Gets a variety of item counts that a genre appears in + */ + self.getGenreItemCounts = function (userId, name) { + + if (!userId) { + throw new Error("null userId"); + } + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Users/{UserId}/Genres/" + encodeName(name) + "/Counts"); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + + /** + Gets a variety of item counts that a studio appears in + */ + self.getStudiosItemCounts = function (userId, name) { + + if (!userId) { + throw new Error("null userId"); + } + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Users/{UserId}/Studios/" + encodeName(name) + "/Counts"); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + /** * Clears a user's personal rating for an item * @param {String} userId diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index edc26a2383..a4c910f732 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file