From 58356619fff85190a5eb7be4872121a2ad8623fb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 27 Jun 2013 16:08:38 -0400 Subject: [PATCH] support refreshing ibn items --- MediaBrowser.WebDashboard/ApiClient.js | 90 +++++++++++++++++++++++ MediaBrowser.WebDashboard/packages.config | 2 +- 2 files changed, 91 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index c6234d41bb..b68241cdde 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -443,6 +443,96 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.refreshArtist = function (name, force) { + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Artists/" + name + "/Refresh", { + + forced: force || false + + }); + + return self.ajax({ + type: "POST", + url: url + }); + }; + + self.refreshGenre = function (name, force) { + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Genres/" + name + "/Refresh", { + + forced: force || false + + }); + + return self.ajax({ + type: "POST", + url: url + }); + }; + + self.refreshMusicGenre = function (name, force) { + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("MusicGenres/" + name + "/Refresh", { + + forced: force || false + + }); + + return self.ajax({ + type: "POST", + url: url + }); + }; + + self.refreshPerson = function (name, force) { + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Persons/" + name + "/Refresh", { + + forced: force || false + + }); + + return self.ajax({ + type: "POST", + url: url + }); + }; + + self.refreshStudio = function (name, force) { + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Studios/" + name + "/Refresh", { + + forced: force || false + + }); + + return self.ajax({ + type: "POST", + url: url + }); + }; + /** * Installs or updates a new plugin */ diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index 980aefd611..d46a5da70a 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file