From 57449f62c16a23448770375b04c4786431170c84 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 1 Jul 2013 13:17:33 -0400 Subject: [PATCH] added GameGenre --- MediaBrowser.Api/BaseApiService.cs | 5 + MediaBrowser.Api/Images/ImageService.cs | 22 +- MediaBrowser.Api/ItemRefreshService.cs | 32 +++ MediaBrowser.Api/ItemUpdateService.cs | 24 +++ MediaBrowser.Api/MediaBrowser.Api.csproj | 1 + .../UserLibrary/GameGenresService.cs | 166 +++++++++++++++ .../UserLibrary/ItemByNameUserDataService.cs | 11 + MediaBrowser.Controller/Entities/GameGenre.cs | 15 ++ .../IServerApplicationPaths.cs | 6 + .../Library/ILibraryManager.cs | 8 + .../MediaBrowser.Controller.csproj | 1 + .../Library/LibraryManager.cs | 11 + .../ServerApplicationPaths.cs | 13 ++ MediaBrowser.WebDashboard/ApiClient.js | 189 +++++++++++++++++- MediaBrowser.WebDashboard/packages.config | 2 +- 15 files changed, 503 insertions(+), 3 deletions(-) create mode 100644 MediaBrowser.Api/UserLibrary/GameGenresService.cs create mode 100644 MediaBrowser.Controller/Entities/GameGenre.cs diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs index b2ab395dba..5147e93dbc 100644 --- a/MediaBrowser.Api/BaseApiService.cs +++ b/MediaBrowser.Api/BaseApiService.cs @@ -115,6 +115,11 @@ namespace MediaBrowser.Api return libraryManager.GetMusicGenre(DeSlugGenreName(name, libraryManager)); } + protected Task GetGameGenre(string name, ILibraryManager libraryManager) + { + return libraryManager.GetGameGenre(DeSlugGenreName(name, libraryManager)); + } + protected Task GetPerson(string name, ILibraryManager libraryManager) { return libraryManager.GetPerson(DeSlugPersonName(name, libraryManager)); diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 70f87e470b..e7b4a42c9e 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -180,7 +180,20 @@ namespace MediaBrowser.Api.Images [ApiMember(Name = "Name", Description = "Genre name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public string Name { get; set; } } - + + [Route("/GameGenres/{Name}/Images/{Type}", "GET")] + [Route("/GameGenres/{Name}/Images/{Type}/{Index}", "GET")] + [Api(Description = "Gets a genre image")] + public class GetGameGenreImage : ImageRequest + { + /// + /// Gets or sets the name. + /// + /// The name. + [ApiMember(Name = "Name", Description = "Genre name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public string Name { get; set; } + } + /// /// Class GetYearImage /// @@ -530,6 +543,13 @@ namespace MediaBrowser.Api.Images return GetImage(request, item); } + public object Get(GetGameGenreImage request) + { + var item = GetGameGenre(request.Name, _libraryManager).Result; + + return GetImage(request, item); + } + /// /// Posts the specified request. /// diff --git a/MediaBrowser.Api/ItemRefreshService.cs b/MediaBrowser.Api/ItemRefreshService.cs index 71f07fb359..f6e5a2cba2 100644 --- a/MediaBrowser.Api/ItemRefreshService.cs +++ b/MediaBrowser.Api/ItemRefreshService.cs @@ -56,6 +56,17 @@ namespace MediaBrowser.Api public string Name { get; set; } } + [Route("/GameGenres/{Name}/Refresh", "POST")] + [Api(Description = "Refreshes metadata for a game genre")] + public class RefreshGameGenre : IReturnVoid + { + [ApiMember(Name = "Forced", Description = "Indicates if a normal or forced refresh should occur.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "POST")] + public bool Forced { get; set; } + + [ApiMember(Name = "Name", Description = "Name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] + public string Name { get; set; } + } + [Route("/Persons/{Name}/Refresh", "POST")] [Api(Description = "Refreshes metadata for a person")] public class RefreshPerson : IReturnVoid @@ -152,6 +163,27 @@ namespace MediaBrowser.Api } } + public void Post(RefreshGameGenre request) + { + var task = RefreshGameGenre(request); + + Task.WaitAll(task); + } + + private async Task RefreshGameGenre(RefreshGameGenre request) + { + var item = await GetGameGenre(request.Name, _libraryManager).ConfigureAwait(false); + + try + { + await item.RefreshMetadata(CancellationToken.None, forceRefresh: request.Forced).ConfigureAwait(false); + } + catch (Exception ex) + { + Logger.ErrorException("Error refreshing library", ex); + } + } + public void Post(RefreshPerson request) { var task = RefreshPerson(request); diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 42a2a3b5c8..71f1e0ddc5 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -53,6 +53,14 @@ namespace MediaBrowser.Api public string GenreName { get; set; } } + [Route("/GameGenres/{GenreName}", "POST")] + [Api(("Updates a game genre"))] + public class UpdateGameGenre : BaseItemDto, IReturnVoid + { + [ApiMember(Name = "GenreName", Description = "The name of the item", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")] + public string GenreName { get; set; } + } + [Route("/Genres/{GenreName}", "POST")] [Api(("Updates a genre"))] public class UpdateGenre : BaseItemDto, IReturnVoid @@ -152,6 +160,22 @@ namespace MediaBrowser.Api await _libraryManager.UpdateItem(item, ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); } + public void Post(UpdateGameGenre request) + { + var task = UpdateItem(request); + + Task.WaitAll(task); + } + + private async Task UpdateItem(UpdateGameGenre request) + { + var item = await _libraryManager.GetGameGenre(request.GenreName).ConfigureAwait(false); + + UpdateItem(request, item); + + await _libraryManager.UpdateItem(item, ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); + } + public void Post(UpdateGenre request) { var task = UpdateItem(request); diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index 60583f4462..d22fa5c8ae 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -106,6 +106,7 @@ + diff --git a/MediaBrowser.Api/UserLibrary/GameGenresService.cs b/MediaBrowser.Api/UserLibrary/GameGenresService.cs new file mode 100644 index 0000000000..fc99ce6b80 --- /dev/null +++ b/MediaBrowser.Api/UserLibrary/GameGenresService.cs @@ -0,0 +1,166 @@ +using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Audio; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Persistence; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Querying; +using ServiceStack.ServiceHost; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace MediaBrowser.Api.UserLibrary +{ + [Route("/GameGenres", "GET")] + [Api(Description = "Gets all Game genres from a given item, folder, or the entire library")] + public class GetGameGenres : GetItemsByName + { + public GetGameGenres() + { + IncludeItemTypes = typeof(Audio).Name; + } + } + + [Route("/GameGenres/{Name}/Counts", "GET")] + [Api(Description = "Gets item counts of library items that a genre appears in")] + public class GetGameGenreItemCounts : IReturn + { + /// + /// Gets or sets the user id. + /// + /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public Guid? UserId { get; set; } + + /// + /// Gets or sets the name. + /// + /// The name. + [ApiMember(Name = "Name", Description = "The genre name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public string Name { get; set; } + } + + [Route("/GameGenres/{Name}", "GET")] + [Api(Description = "Gets a Game genre, by name")] + public class GetGameGenre : IReturn + { + /// + /// Gets or sets the name. + /// + /// The name. + [ApiMember(Name = "Name", Description = "The genre name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public string Name { get; set; } + + /// + /// Gets or sets the user id. + /// + /// The user id. + [ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public Guid? UserId { get; set; } + } + + public class GameGenresService : BaseItemsByNameService + { + public GameGenresService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepo) + : base(userManager, libraryManager, userDataRepository, itemRepo) + { + } + + /// + /// Gets the specified request. + /// + /// The request. + /// System.Object. + public object Get(GetGameGenre request) + { + var result = GetItem(request).Result; + + return ToOptimizedResult(result); + } + + /// + /// Gets the item. + /// + /// The request. + /// Task{BaseItemDto}. + private async Task GetItem(GetGameGenre request) + { + var item = await GetGameGenre(request.Name, LibraryManager).ConfigureAwait(false); + + // Get everything + var fields = Enum.GetNames(typeof(ItemFields)).Select(i => (ItemFields)Enum.Parse(typeof(ItemFields), i, true)); + + var builder = new DtoBuilder(Logger, LibraryManager, UserDataRepository, ItemRepository); + + if (request.UserId.HasValue) + { + var user = UserManager.GetUserById(request.UserId.Value); + + return await builder.GetBaseItemDto(item, fields.ToList(), user).ConfigureAwait(false); + } + + return await builder.GetBaseItemDto(item, fields.ToList()).ConfigureAwait(false); + } + + /// + /// Gets the specified request. + /// + /// The request. + /// System.Object. + public object Get(GetGameGenres request) + { + var result = GetResult(request).Result; + + return ToOptimizedResult(result); + } + + /// + /// Gets all items. + /// + /// The request. + /// The items. + /// IEnumerable{Tuple{System.StringFunc{System.Int32}}}. + protected override IEnumerable> GetAllItems(GetItemsByName request, IEnumerable items) + { + var itemsList = items.Where(i => i.Genres != null).ToList(); + + return itemsList + .SelectMany(i => i.Genres) + .Distinct(StringComparer.OrdinalIgnoreCase) + .Select(name => new IbnStub(name, () => itemsList.Where(i => i.Genres.Contains(name, StringComparer.OrdinalIgnoreCase)), GetEntity)); + } + + /// + /// Gets the entity. + /// + /// The name. + /// Task{Genre}. + protected Task GetEntity(string name) + { + return LibraryManager.GetGameGenre(name); + } + + /// + /// Gets the specified request. + /// + /// The request. + /// System.Object. + public object Get(GetGameGenreItemCounts request) + { + var name = DeSlugGenreName(request.Name, LibraryManager); + + var items = GetItems(request.UserId).Where(i => i.Genres != null && i.Genres.Contains(name, StringComparer.OrdinalIgnoreCase)).ToList(); + + var counts = new ItemByNameCounts + { + TotalCount = items.Count, + + GameCount = items.OfType().Count() + }; + + return ToOptimizedResult(counts); + } + } +} diff --git a/MediaBrowser.Api/UserLibrary/ItemByNameUserDataService.cs b/MediaBrowser.Api/UserLibrary/ItemByNameUserDataService.cs index eaa65dc2db..07885346bb 100644 --- a/MediaBrowser.Api/UserLibrary/ItemByNameUserDataService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemByNameUserDataService.cs @@ -17,6 +17,7 @@ namespace MediaBrowser.Api.UserLibrary [Route("/Users/{UserId}/Favorites/Studios/{Name}", "POST")] [Route("/Users/{UserId}/Favorites/Genres/{Name}", "POST")] [Route("/Users/{UserId}/Favorites/MusicGenres/{Name}", "POST")] + [Route("/Users/{UserId}/Favorites/GameGenres/{Name}", "POST")] [Api(Description = "Marks something as a favorite")] public class MarkItemByNameFavorite : IReturnVoid { @@ -43,6 +44,7 @@ namespace MediaBrowser.Api.UserLibrary [Route("/Users/{UserId}/Favorites/Studios/{Name}", "DELETE")] [Route("/Users/{UserId}/Favorites/Genres/{Name}", "DELETE")] [Route("/Users/{UserId}/Favorites/MusicGenres/{Name}", "DELETE")] + [Route("/Users/{UserId}/Favorites/GameGenres/{Name}", "DELETE")] [Api(Description = "Unmarks something as a favorite")] public class UnmarkItemByNameFavorite : IReturnVoid { @@ -102,6 +104,7 @@ namespace MediaBrowser.Api.UserLibrary [Route("/Users/{UserId}/Ratings/Studios/{Name}", "DELETE")] [Route("/Users/{UserId}/Ratings/Genres/{Name}", "DELETE")] [Route("/Users/{UserId}/Ratings/MusicGenres/{Name}", "DELETE")] + [Route("/Users/{UserId}/Ratings/GameGenres/{Name}", "DELETE")] [Api(Description = "Deletes a user's saved personal rating for an item")] public class DeleteItemByNameRating : IReturnVoid { @@ -230,6 +233,10 @@ namespace MediaBrowser.Api.UserLibrary { item = await GetMusicGenre(name, LibraryManager).ConfigureAwait(false); } + else if (string.Equals(type, "GameGenres")) + { + item = await GetGameGenre(name, LibraryManager).ConfigureAwait(false); + } else if (string.Equals(type, "Studios")) { item = await GetStudio(name, LibraryManager).ConfigureAwait(false); @@ -278,6 +285,10 @@ namespace MediaBrowser.Api.UserLibrary { item = await GetMusicGenre(name, LibraryManager).ConfigureAwait(false); } + else if (string.Equals(type, "GameGenres")) + { + item = await GetGameGenre(name, LibraryManager).ConfigureAwait(false); + } else if (string.Equals(type, "Studios")) { item = await GetStudio(name, LibraryManager).ConfigureAwait(false); diff --git a/MediaBrowser.Controller/Entities/GameGenre.cs b/MediaBrowser.Controller/Entities/GameGenre.cs new file mode 100644 index 0000000000..f2462aac2d --- /dev/null +++ b/MediaBrowser.Controller/Entities/GameGenre.cs @@ -0,0 +1,15 @@ + +namespace MediaBrowser.Controller.Entities +{ + public class GameGenre : BaseItem, IItemByName + { + /// + /// Gets the user data key. + /// + /// System.String. + public override string GetUserDataKey() + { + return "GameGenre-" + Name; + } + } +} diff --git a/MediaBrowser.Controller/IServerApplicationPaths.cs b/MediaBrowser.Controller/IServerApplicationPaths.cs index 58b6bb12f2..57cb7c7dd4 100644 --- a/MediaBrowser.Controller/IServerApplicationPaths.cs +++ b/MediaBrowser.Controller/IServerApplicationPaths.cs @@ -45,6 +45,12 @@ namespace MediaBrowser.Controller /// /// The music genre path. string MusicGenrePath { get; } + + /// + /// Gets the game genre path. + /// + /// The game genre path. + string GameGenrePath { get; } /// /// Gets the artists path. diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 6accb0f4a6..ddfec703c5 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -87,6 +87,14 @@ namespace MediaBrowser.Controller.Library /// if set to true [allow slow providers]. /// Task{MusicGenre}. Task GetMusicGenre(string name, bool allowSlowProviders = false); + + /// + /// Gets the game genre. + /// + /// The name. + /// if set to true [allow slow providers]. + /// Task{GameGenre}. + Task GetGameGenre(string name, bool allowSlowProviders = false); /// /// Gets a Year diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 228c6380fa..502c7a7b82 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -75,6 +75,7 @@ + diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 762be2e9ed..810f54c26e 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -662,6 +662,17 @@ namespace MediaBrowser.Server.Implementations.Library return GetItemByName(ConfigurationManager.ApplicationPaths.MusicGenrePath, name, CancellationToken.None, allowSlowProviders); } + /// + /// Gets the game genre. + /// + /// The name. + /// if set to true [allow slow providers]. + /// Task{GameGenre}. + public Task GetGameGenre(string name, bool allowSlowProviders = false) + { + return GetItemByName(ConfigurationManager.ApplicationPaths.GameGenrePath, name, CancellationToken.None, allowSlowProviders); + } + /// /// Gets a Genre /// diff --git a/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs b/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs index c2512e0167..ac552b8de2 100644 --- a/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs +++ b/MediaBrowser.Server.Implementations/ServerApplicationPaths.cs @@ -225,5 +225,18 @@ namespace MediaBrowser.Server.Implementations return Path.Combine(ItemsByNamePath, "artists"); } } + + + /// + /// Gets the game genre path. + /// + /// The game genre path. + public string GameGenrePath + { + get + { + return Path.Combine(ItemsByNamePath, "GameGenre"); + } + } } } diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index 0561403047..ebea5b9860 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -497,6 +497,24 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.refreshGameGenre = function (name, force) { + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("GameGenres/" + self.encodeName(name) + "/Refresh", { + + forced: force || false + + }); + + return self.ajax({ + type: "POST", + url: url + }); + }; + self.refreshPerson = function (name, force) { if (!name) { @@ -1263,6 +1281,27 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.getGameGenre = function (name, userId) { + + if (!name) { + throw new Error("null name"); + } + + var options = {}; + + if (userId) { + options.userId = userId; + } + + var url = self.getUrl("GameGenres/" + self.encodeName(name), options); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + /** * Gets an artist */ @@ -1552,6 +1591,41 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { return self.getUrl(url, options); }; + /** + * Constructs a url for a genre image + * @param {String} name + * @param {Object} options + * Options supports the following properties: + * width - download the image at a fixed width + * height - download the image at a fixed height + * maxWidth - download the image at a maxWidth + * maxHeight - download the image at a maxHeight + * quality - A scale of 0-100. This should almost always be omitted as the default will suffice. + * For best results do not specify both width and height together, as aspect ratio might be altered. + */ + self.getGameGenreImageUrl = function (name, options) { + + if (!name) { + throw new Error("null name"); + } + + options = options || { + + }; + + var url = "GameGenres/" + self.encodeName(name) + "/Images/" + options.type; + + if (options.index != null) { + url += "/" + options.index; + } + + // Don't put these on the query string + delete options.type; + delete options.index; + + return self.getUrl(url, options); + }; + /** * Constructs a url for a artist image * @param {String} name @@ -1922,7 +1996,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; - self.updateMusicGenres = function (item) { + self.updateMusicGenre = function (item) { if (!item) { throw new Error("null item"); @@ -1938,6 +2012,22 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.updateGameGenre = function (item) { + + if (!item) { + throw new Error("null item"); + } + + var url = self.getUrl("GameGenres/" + self.encodeName(item.Name)); + + return self.ajax({ + type: "POST", + url: url, + data: JSON.stringify(item), + contentType: "application/json" + }); + }; + /** * Updates plugin security info */ @@ -2136,6 +2226,24 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.getGameGenres = function (userId, options) { + + if (!userId) { + throw new Error("null userId"); + } + + options = options || {}; + options.userId = userId; + + var url = self.getUrl("GameGenres", options); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + /** Gets people from an item */ @@ -2484,6 +2592,26 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.updateFavoriteGameGenreStatus = function (userId, name, isFavorite) { + + if (!userId) { + throw new Error("null userId"); + } + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Users/" + userId + "/Favorites/GameGenres/" + self.encodeName(name)); + + var method = isFavorite ? "POST" : "DELETE"; + + return self.ajax({ + type: method, + url: url + }); + }; + /** * Updates a user's rating for an item by name. * @param {String} userId @@ -2590,6 +2718,26 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.updateGameGenreRating = function (userId, name, likes) { + + if (!userId) { + throw new Error("null userId"); + } + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Users/" + userId + "/Ratings/GameGenres/" + self.encodeName(name), { + likes: likes + }); + + return self.ajax({ + type: "POST", + url: url + }); + }; + /** * Clears a user's rating for an item by name. * @param {String} userId @@ -2685,6 +2833,24 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.clearGameGenreRating = function (userId, name) { + + if (!userId) { + throw new Error("null userId"); + } + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("Users/" + userId + "/Ratings/GameGenres/" + self.encodeName(name)); + + return self.ajax({ + type: "DELETE", + url: url + }); + }; + self.getItemCounts = function (userId) { var options = {}; @@ -2771,6 +2937,27 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + self.getGameGenreItemCounts = function (userId, name) { + + if (!userId) { + throw new Error("null userId"); + } + + if (!name) { + throw new Error("null name"); + } + + var url = self.getUrl("GameGenres/" + self.encodeName(name) + "/Counts", { + userId: userId + }); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + /** Gets a variety of item counts that an artist appears in */ diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index ab134ebdaa..ef87d534e7 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file