mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 09:34:44 +01:00
add ability to mark studios, genres and people as favorites
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user