|
|
@ -399,6 +399,45 @@ namespace MediaBrowser.ApiInteraction.Portable
|
|
|
|
GetDataAsync(url, callback);
|
|
|
|
GetDataAsync(url, callback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Clears a user's rating for an item
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public void ClearUserItemRatingAsync(Guid itemId, Guid userId, Action<DTOUserItemData> callback)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string url = ApiUrl + "/UserItemRating?id=" + itemId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
url += "&userid=" + userId;
|
|
|
|
|
|
|
|
url += "&clear=1";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetDataAsync(url, callback);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Updates a user's rating for an item, based on a numeric scale
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public void UpdateUserItemRatingAsync(Guid itemId, Guid userId, float value, Action<DTOUserItemData> callback)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string url = ApiUrl + "/UserItemRating?id=" + itemId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
url += "&userid=" + userId;
|
|
|
|
|
|
|
|
url += "&value=" + value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetDataAsync(url, callback);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Updates a user's rating for an item, based on likes or dislikes
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public void UpdateUserItemRatingAsync(Guid itemId, Guid userId, bool likes, Action<DTOUserItemData> callback)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string url = ApiUrl + "/UserItemRating?id=" + itemId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
url += "&userid=" + userId;
|
|
|
|
|
|
|
|
url += "&likes=" + (likes ? "1" : "0");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetDataAsync(url, callback);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Performs a GET request, and deserializes the response stream to an object of Type T
|
|
|
|
/// Performs a GET request, and deserializes the response stream to an object of Type T
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|