diff --git a/MediaBrowser.Api/DefaultTheme/DefaultThemeService.cs b/MediaBrowser.Api/DefaultTheme/DefaultThemeService.cs index bb23f7f7e..df69f68f8 100644 --- a/MediaBrowser.Api/DefaultTheme/DefaultThemeService.cs +++ b/MediaBrowser.Api/DefaultTheme/DefaultThemeService.cs @@ -288,9 +288,6 @@ namespace MediaBrowser.Api.DefaultTheme var view = new TvView(); - SetFavoriteGenres(view, series, user); - SetFavoriteStudios(view, series, user); - var fields = new List(); var seriesWithBestBackdrops = FilterItemsForBackdropDisplay(seriesWithBackdrops).ToList(); @@ -401,146 +398,6 @@ namespace MediaBrowser.Api.DefaultTheme return ToOptimizedResult(view); } - private void SetFavoriteGenres(TvView view, IEnumerable inputItems, User user) - { - var all = inputItems.SelectMany(i => i.Genres) - .Distinct(StringComparer.OrdinalIgnoreCase); - - view.FavoriteGenres = all.Select(i => - { - try - { - var itemByName = _libraryManager.GetGenre(i); - - var counts = itemByName.GetItemByNameCounts(user); - - var count = counts == null ? 0 : counts.SeriesCount; - - if (count > 0 && _userDataManager.GetUserData(user.Id, itemByName.GetUserDataKey()).IsFavorite) - { - return new ItemByNameInfo - { - Name = itemByName.Name, - ItemCount = count - }; - } - } - catch (Exception ex) - { - _logger.ErrorException("Error getting genre {0}", ex, i); - - } - - return null; - - }).Where(i => i != null).ToList(); - } - - private void SetFavoriteStudios(TvView view, IEnumerable inputItems, User user) - { - var all = inputItems.SelectMany(i => i.Studios) - .Distinct(StringComparer.OrdinalIgnoreCase); - - view.FavoriteStudios = all.Select(i => - { - try - { - var itemByName = _libraryManager.GetStudio(i); - - var counts = itemByName.GetItemByNameCounts(user); - - var count = counts == null ? 0 : counts.SeriesCount; - - if (count > 0 && _userDataManager.GetUserData(user.Id, itemByName.GetUserDataKey()).IsFavorite) - { - return new ItemByNameInfo - { - Name = itemByName.Name, - ItemCount = count - }; - } - } - catch (Exception ex) - { - _logger.ErrorException("Error getting studio {0}", ex, i); - - } - - return null; - - }).Where(i => i != null).ToList(); - } - - private void SetFavoriteGenres(MoviesView view, IEnumerable inputItems, User user) - { - var all = inputItems.SelectMany(i => i.Genres) - .Distinct(StringComparer.OrdinalIgnoreCase); - - view.FavoriteGenres = all.Select(i => - { - try - { - var itemByName = _libraryManager.GetGenre(i); - - var counts = itemByName.GetItemByNameCounts(user); - - var count = counts == null ? 0 : counts.MovieCount; - - if (count > 0 && _userDataManager.GetUserData(user.Id, itemByName.GetUserDataKey()).IsFavorite) - { - return new ItemByNameInfo - { - Name = itemByName.Name, - ItemCount = count - }; - } - } - catch (Exception ex) - { - _logger.ErrorException("Error getting genre {0}", ex, i); - - } - - return null; - - }).Where(i => i != null).ToList(); - } - - private void SetFavoriteStudios(MoviesView view, IEnumerable inputItems, User user) - { - var all = inputItems.SelectMany(i => i.Studios) - .Distinct(StringComparer.OrdinalIgnoreCase); - - view.FavoriteStudios = all.Select(i => - { - try - { - var itemByName = _libraryManager.GetStudio(i); - - var counts = itemByName.GetItemByNameCounts(user); - - var count = counts == null ? 0 : counts.MovieCount; - - if (count > 0 && _userDataManager.GetUserData(user.Id, itemByName.GetUserDataKey()).IsFavorite) - { - return new ItemByNameInfo - { - Name = itemByName.Name, - ItemCount = count - }; - } - } - catch (Exception ex) - { - _logger.ErrorException("Error getting studio {0}", ex, i); - - } - - return null; - - }).Where(i => i != null).ToList(); - } - public object Get(GetMovieView request) { var user = _userManager.GetUserById(request.UserId); @@ -557,9 +414,6 @@ namespace MediaBrowser.Api.DefaultTheme var movies = items.OfType() .ToList(); - SetFavoriteGenres(view, movies, user); - SetFavoriteStudios(view, movies, user); - var trailers = items.OfType() .ToList(); diff --git a/MediaBrowser.Api/DefaultTheme/Models.cs b/MediaBrowser.Api/DefaultTheme/Models.cs index bdff82de2..5219c44f9 100644 --- a/MediaBrowser.Api/DefaultTheme/Models.cs +++ b/MediaBrowser.Api/DefaultTheme/Models.cs @@ -34,9 +34,6 @@ namespace MediaBrowser.Api.DefaultTheme public List LatestTrailers { get; set; } public List LatestMovies { get; set; } - - public List FavoriteGenres { get; set; } - public List FavoriteStudios { get; set; } } public class TvView : BaseView @@ -47,8 +44,6 @@ namespace MediaBrowser.Api.DefaultTheme public List RomanceItems { get; set; } public List ComedyItems { get; set; } - public List FavoriteGenres { get; set; } - public List FavoriteStudios { get; set; } public List SeriesIdsInProgress { get; set; } public List LatestEpisodes { get; set; } diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 501095f24..1d50a5933 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -383,6 +383,12 @@ namespace MediaBrowser.Model.Dto /// The album image tag. public Guid? AlbumPrimaryImageTag { get; set; } + /// + /// Gets or sets the series primary image tag. + /// + /// The series primary image tag. + public Guid? SeriesPrimaryImageTag { get; set; } + /// /// Gets or sets the album artist. ///