diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs
index 15f09f375..3e0f24999 100644
--- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs
+++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs
@@ -78,7 +78,7 @@ namespace MediaBrowser.Api.UserLibrary
/// Class UpdateDisplayPreferences
///
[Route("/Users/{UserId}/Items/{Id}/DisplayPreferences", "POST")]
- [ServiceStack.ServiceHost.Api(("Updates a user's display preferences for an item"))]
+ [Api(("Updates a user's display preferences for an item"))]
public class UpdateDisplayPreferences : DisplayPreferences, IReturnVoid
{
///
@@ -93,7 +93,7 @@ namespace MediaBrowser.Api.UserLibrary
/// Class MarkFavoriteItem
///
[Route("/Users/{UserId}/FavoriteItems/{Id}", "POST")]
- [ServiceStack.ServiceHost.Api(Description = "Marks an item as a favorite")]
+ [Api(Description = "Marks an item as a favorite")]
public class MarkFavoriteItem : IReturnVoid
{
///
@@ -115,7 +115,7 @@ namespace MediaBrowser.Api.UserLibrary
/// Class UnmarkFavoriteItem
///
[Route("/Users/{UserId}/FavoriteItems/{Id}", "DELETE")]
- [ServiceStack.ServiceHost.Api(Description = "Unmarks an item as a favorite")]
+ [Api(Description = "Unmarks an item as a favorite")]
public class UnmarkFavoriteItem : IReturnVoid
{
///
@@ -498,7 +498,7 @@ namespace MediaBrowser.Api.UserLibrary
{
var user = _userManager.GetUserById(request.UserId);
- var item = (Folder)DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);
+ var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);
// Get the user data for this item
var data = item.GetUserData(user, true);
@@ -519,7 +519,7 @@ namespace MediaBrowser.Api.UserLibrary
{
var user = _userManager.GetUserById(request.UserId);
- var item = (Folder)DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);
+ var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);
// Get the user data for this item
var data = item.GetUserData(user, true);
@@ -540,7 +540,7 @@ namespace MediaBrowser.Api.UserLibrary
{
var user = _userManager.GetUserById(request.UserId);
- var item = (Folder)DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);
+ var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);
// Get the user data for this item
var data = item.GetUserData(user, true);
@@ -560,7 +560,7 @@ namespace MediaBrowser.Api.UserLibrary
{
var user = _userManager.GetUserById(request.UserId);
- var item = (Folder)DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);
+ var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id);
// Get the user data for this item
var data = item.GetUserData(user, true);
diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js
index 0f014f870..8380dc8e5 100644
--- a/MediaBrowser.WebDashboard/ApiClient.js
+++ b/MediaBrowser.WebDashboard/ApiClient.js
@@ -213,7 +213,17 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
*/
self.getRootFolder = function (userId) {
- return self.getItem(userId);
+ if (!userId) {
+ throw new Error("null userId");
+ }
+
+ var url = self.getUrl("Users/" + userId + "/Items/Root");
+
+ return self.ajax({
+ type: "GET",
+ url: url,
+ dataType: "json"
+ });
};
/**
@@ -1577,7 +1587,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
throw new Error("null itemId");
}
- var url = "Users/" + userId + "/PlayedItems/" + itemId;
+ var url = self.getUrl("Users/" + userId + "/PlayedItems/" + itemId);
var method = wasPlayed ? "POST" : "DELETE";
@@ -1604,7 +1614,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
throw new Error("null itemId");
}
- var url = "Users/" + userId + "/FavoriteItems/" + itemId;
+ var url = self.getUrl("Users/" + userId + "/FavoriteItems/" + itemId);
var method = isFavorite ? "POST" : "DELETE";
diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config
index f1726c072..42d7b089c 100644
--- a/MediaBrowser.WebDashboard/packages.config
+++ b/MediaBrowser.WebDashboard/packages.config
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file