add ability to mark studios, genres and people as favorites

This commit is contained in:
Luke Pulverenti
2013-04-12 20:42:51 -04:00
parent b721aab2ba
commit b3cb8fda22
7 changed files with 289 additions and 5 deletions

View File

@@ -417,7 +417,6 @@ namespace MediaBrowser.WebDashboard.Api
"http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js",
"http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js",
"http://vjs.zencdn.net/c/video.js",
"thirdparty/jplayer/jquery.jplayer.min.js" + versionString,
"scripts/all.js" + versionString
};

View File

@@ -1671,7 +1671,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
};
/**
* Updates a user's favorite status for an item and returns the updated UserItemData object.
* Updates a user's favorite status for an item.
* @param {String} userId
* @param {String} itemId
* @param {Boolean} isFavorite
@@ -1723,6 +1723,87 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
});
};
/**
* Updates a user's favorite status for a person.
* @param {String} userId
* @param {String} name
* @param {Boolean} isFavorite
*/
self.updateFavoritePersonStatus = function (userId, name, isFavorite) {
if (!userId) {
throw new Error("null userId");
}
if (!name) {
throw new Error("null name");
}
var url = self.getUrl("Users/" + userId + "/FavoritePersons/" + name);
var method = isFavorite ? "POST" : "DELETE";
return self.ajax({
type: method,
url: url,
dataType: "json"
});
};
/**
* Updates a user's favorite status for a genre.
* @param {String} userId
* @param {String} name
* @param {Boolean} isFavorite
*/
self.updateFavoriteGenreStatus = function (userId, name, isFavorite) {
if (!userId) {
throw new Error("null userId");
}
if (!name) {
throw new Error("null name");
}
var url = self.getUrl("Users/" + userId + "/FavoriteGenre/" + name);
var method = isFavorite ? "POST" : "DELETE";
return self.ajax({
type: method,
url: url,
dataType: "json"
});
};
/**
* Updates a user's favorite status for a studio.
* @param {String} userId
* @param {String} name
* @param {Boolean} isFavorite
*/
self.updateFavoriteStudioStatus = function (userId, name, isFavorite) {
if (!userId) {
throw new Error("null userId");
}
if (!name) {
throw new Error("null name");
}
var url = self.getUrl("Users/" + userId + "/FavoriteStudios/" + name);
var method = isFavorite ? "POST" : "DELETE";
return self.ajax({
type: method,
url: url,
dataType: "json"
});
};
/**
* Clears a user's personal rating for an item
* @param {String} userId

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.73" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.74" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.43" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.43" targetFramework="net45" />
</packages>