added more info to user library counts
This commit is contained in:
parent
2456a66e85
commit
a3a658e820
|
@ -51,8 +51,8 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
public string RomanceGenre { get; set; }
|
||||
}
|
||||
|
||||
[Route("/MBT/DefaultTheme/Home", "GET")]
|
||||
public class GetHomeView : IReturn<HomeView>
|
||||
[Route("/MBT/DefaultTheme/Favorites", "GET")]
|
||||
public class GetFavoritesView : IReturn<FavoritesView>
|
||||
{
|
||||
[ApiMember(Name = "UserId", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
|
||||
public Guid UserId { get; set; }
|
||||
|
@ -78,47 +78,103 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
_userDataManager = userDataManager;
|
||||
}
|
||||
|
||||
public object Get(GetHomeView request)
|
||||
{
|
||||
var result = GetHomeView(request);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
private HomeView GetHomeView(GetHomeView request)
|
||||
public object Get(GetFavoritesView request)
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
var allItems = user.RootFolder.GetRecursiveChildren(user)
|
||||
var allItems = user.RootFolder.GetRecursiveChildren(user, i => _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).IsFavorite)
|
||||
.ToList();
|
||||
|
||||
var itemsWithBackdrops = allItems.Where(i => i.BackdropImagePaths.Count > 0).ToList();
|
||||
var itemsWithImages = allItems.Where(i => !string.IsNullOrEmpty(i.PrimaryImagePath))
|
||||
.ToList();
|
||||
|
||||
var view = new HomeView();
|
||||
var itemsWithBackdrops = allItems.Where(i => i.BackdropImagePaths.Count > 0)
|
||||
.ToList();
|
||||
|
||||
var view = new FavoritesView();
|
||||
|
||||
var fields = new List<ItemFields>();
|
||||
|
||||
var eligibleSpotlightItems = itemsWithBackdrops
|
||||
.Where(i => i is Game || i is Movie || i is Series || i is MusicArtist);
|
||||
view.BackdropItems = FilterItemsForBackdropDisplay(itemsWithBackdrops.OrderBy(i => Guid.NewGuid()))
|
||||
.Take(10)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
var dtos = FilterItemsForBackdropDisplay(eligibleSpotlightItems)
|
||||
var spotlightItems = itemsWithBackdrops.OrderBy(i => Guid.NewGuid())
|
||||
.Take(10)
|
||||
.ToList();
|
||||
|
||||
view.SpotlightItems = spotlightItems
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.Albums = itemsWithImages
|
||||
.OfType<MusicAlbum>()
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(50)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
.Take(4)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.SpotlightItems = dtos.ToList();
|
||||
view.Books = itemsWithImages
|
||||
.OfType<Book>()
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(6)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
return view;
|
||||
view.Episodes = itemsWithImages
|
||||
.OfType<Episode>()
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(6)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.Games = itemsWithImages
|
||||
.OfType<Game>()
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(6)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.Movies = itemsWithImages
|
||||
.OfType<Movie>()
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(6)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.Series = itemsWithImages
|
||||
.OfType<Series>()
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(6)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.Songs = itemsWithImages
|
||||
.OfType<Audio>()
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(4)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.Artists = itemsWithImages
|
||||
.OfType<MusicArtist>()
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(4)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.MiniSpotlights = itemsWithBackdrops
|
||||
.Except(spotlightItems)
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(5)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
return ToOptimizedResult(view);
|
||||
}
|
||||
|
||||
public object Get(GetGamesView request)
|
||||
{
|
||||
var result = GetGamesView(request);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
private GamesView GetGamesView(GetGamesView request)
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
|
@ -129,17 +185,23 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
var itemsWithBackdrops = FilterItemsForBackdropDisplay(items.Where(i => i.BackdropImagePaths.Count > 0)).ToList();
|
||||
|
||||
var gamesWithBackdrops = itemsWithBackdrops.OfType<Game>().ToList();
|
||||
|
||||
var view = new GamesView();
|
||||
|
||||
var fields = new List<ItemFields>();
|
||||
|
||||
var dtos = itemsWithBackdrops
|
||||
.OfType<Game>()
|
||||
view.BackdropItems = gamesWithBackdrops
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(50)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
.Take(10)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.SpotlightItems = dtos.ToList();
|
||||
view.SpotlightItems = gamesWithBackdrops
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(10)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.MultiPlayerItems = gamesWithImages
|
||||
.Where(i => i.PlayersSupported.HasValue && i.PlayersSupported.Value > 1)
|
||||
|
@ -149,31 +211,16 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Take(1)
|
||||
.ToList();
|
||||
|
||||
view.MiniSpotlights = itemsWithBackdrops
|
||||
.OfType<Game>()
|
||||
view.MiniSpotlights = gamesWithBackdrops
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(3)
|
||||
.Take(5)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
public object Get(GetMovieView request)
|
||||
{
|
||||
var result = GetMovieView(request);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
return ToOptimizedResult(view);
|
||||
}
|
||||
|
||||
public object Get(GetTvView request)
|
||||
{
|
||||
var result = GetTvView(request);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
private TvView GetTvView(GetTvView request)
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
|
@ -187,13 +234,14 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
var fields = new List<ItemFields>();
|
||||
|
||||
var dtos = FilterItemsForBackdropDisplay(seriesWithBackdrops)
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(50)
|
||||
.AsParallel()
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
var seriesWithBestBackdrops = FilterItemsForBackdropDisplay(seriesWithBackdrops).ToList();
|
||||
|
||||
view.SpotlightItems = dtos.ToList();
|
||||
view.BackdropItems = seriesWithBestBackdrops
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(10)
|
||||
.AsParallel()
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.ShowsItems = series
|
||||
.Where(i => i.BackdropImagePaths.Count > 0)
|
||||
|
@ -224,16 +272,45 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
view.ActorItems = GetActors(series, user.Id);
|
||||
|
||||
view.MiniSpotlights = seriesWithBackdrops
|
||||
var spotlightSeries = seriesWithBestBackdrops
|
||||
.Where(i => i.CommunityRating.HasValue && i.CommunityRating >= 8.5)
|
||||
.ToList();
|
||||
|
||||
if (spotlightSeries.Count < 20)
|
||||
{
|
||||
spotlightSeries = seriesWithBestBackdrops;
|
||||
}
|
||||
|
||||
spotlightSeries = spotlightSeries
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(10)
|
||||
.ToList();
|
||||
|
||||
view.SpotlightItems = spotlightSeries
|
||||
.AsParallel()
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
var miniSpotlightItems = seriesWithBackdrops
|
||||
.Except(spotlightSeries.OfType<Series>())
|
||||
.Where(i => i.CommunityRating.HasValue && i.CommunityRating >= 8)
|
||||
.ToList();
|
||||
|
||||
if (miniSpotlightItems.Count < 15)
|
||||
{
|
||||
miniSpotlightItems = seriesWithBackdrops;
|
||||
}
|
||||
|
||||
view.MiniSpotlights = miniSpotlightItems
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(3)
|
||||
.Take(5)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
return view;
|
||||
|
||||
return ToOptimizedResult(view);
|
||||
}
|
||||
|
||||
private MoviesView GetMovieView(GetMovieView request)
|
||||
public object Get(GetMovieView request)
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
|
@ -241,7 +318,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.ToList();
|
||||
|
||||
// Exclude trailers from backdrops because they're not always 1080p
|
||||
var itemsWithBackdrops = items.Where(i => i.BackdropImagePaths.Count > 0 && !(i is Trailer))
|
||||
var itemsWithBackdrops = items.Where(i => i.BackdropImagePaths.Count > 0)
|
||||
.ToList();
|
||||
|
||||
var view = new MoviesView();
|
||||
|
@ -267,12 +344,14 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
var fields = new List<ItemFields>();
|
||||
|
||||
var dtos = FilterItemsForBackdropDisplay(itemsWithBackdrops)
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(50)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
var itemsWithTopBackdrops = FilterItemsForBackdropDisplay(itemsWithBackdrops).ToList();
|
||||
|
||||
view.SpotlightItems = dtos.ToList();
|
||||
view.BackdropItems = itemsWithTopBackdrops
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(10)
|
||||
.AsParallel()
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.MovieItems = moviesWithBackdrops
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
|
@ -344,13 +423,52 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
view.PeopleItems = GetActors(items, user.Id);
|
||||
|
||||
view.MiniSpotlights = moviesWithBackdrops
|
||||
var spotlightItems = itemsWithTopBackdrops
|
||||
.Where(i => i.CommunityRating.HasValue && i.CommunityRating >= 8)
|
||||
.ToList();
|
||||
|
||||
if (spotlightItems.Count < 20)
|
||||
{
|
||||
spotlightItems = itemsWithTopBackdrops;
|
||||
}
|
||||
|
||||
spotlightItems = spotlightItems
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(10)
|
||||
.ToList();
|
||||
|
||||
view.SpotlightItems = spotlightItems
|
||||
.AsParallel()
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
var miniSpotlightItems = moviesWithBackdrops
|
||||
.Except(spotlightItems)
|
||||
.Where(i => i.CommunityRating.HasValue && i.CommunityRating >= 7.5)
|
||||
.ToList();
|
||||
|
||||
if (miniSpotlightItems.Count < 15)
|
||||
{
|
||||
miniSpotlightItems = itemsWithTopBackdrops;
|
||||
}
|
||||
|
||||
miniSpotlightItems = miniSpotlightItems
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Take(3)
|
||||
.ToList();
|
||||
|
||||
// Avoid implicitly captured closure
|
||||
var currentUserId = user.Id;
|
||||
miniSpotlightItems.InsertRange(2, moviesWithBackdrops
|
||||
.Where(i => _userDataManager.GetUserData(currentUserId, i.GetUserDataKey()).PlaybackPositionTicks > 0)
|
||||
.OrderByDescending(i => _userDataManager.GetUserData(currentUserId, i.GetUserDataKey()).LastPlayedDate ?? DateTime.MaxValue)
|
||||
.Take(3));
|
||||
|
||||
view.MiniSpotlights = miniSpotlightItems
|
||||
.Take(5)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
return view;
|
||||
return ToOptimizedResult(view);
|
||||
}
|
||||
|
||||
private IEnumerable<BaseItem> FilterItemsForBackdropDisplay(IEnumerable<BaseItem> items)
|
||||
|
|
|
@ -50,13 +50,20 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
public class BaseView
|
||||
{
|
||||
public List<BaseItemDto> BackdropItems { get; set; }
|
||||
public List<BaseItemDto> SpotlightItems { get; set; }
|
||||
|
||||
public List<BaseItemDto> MiniSpotlights { get; set; }
|
||||
}
|
||||
|
||||
public class HomeView
|
||||
public class FavoritesView : BaseView
|
||||
{
|
||||
public List<BaseItemDto> SpotlightItems { get; set; }
|
||||
public List<BaseItemDto> Movies { get; set; }
|
||||
public List<BaseItemDto> Series { get; set; }
|
||||
public List<BaseItemDto> Episodes { get; set; }
|
||||
public List<BaseItemDto> Games { get; set; }
|
||||
public List<BaseItemDto> Books { get; set; }
|
||||
public List<BaseItemDto> Albums { get; set; }
|
||||
public List<BaseItemDto> Songs { get; set; }
|
||||
public List<BaseItemDto> Artists { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,6 +204,7 @@ namespace MediaBrowser.Api
|
|||
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IUserDataManager _userDataManager;
|
||||
|
||||
private readonly IDtoService _dtoService;
|
||||
|
||||
|
@ -211,12 +212,13 @@ namespace MediaBrowser.Api
|
|||
/// Initializes a new instance of the <see cref="LibraryService" /> class.
|
||||
/// </summary>
|
||||
public LibraryService(IItemRepository itemRepo, ILibraryManager libraryManager, IUserManager userManager,
|
||||
IDtoService dtoService)
|
||||
IDtoService dtoService, IUserDataManager userDataManager)
|
||||
{
|
||||
_itemRepo = itemRepo;
|
||||
_libraryManager = libraryManager;
|
||||
_userManager = userManager;
|
||||
_dtoService = dtoService;
|
||||
_userDataManager = userDataManager;
|
||||
}
|
||||
|
||||
public object Get(GetFile request)
|
||||
|
@ -332,27 +334,59 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
var items = GetAllLibraryItems(request.UserId, _userManager, _libraryManager).ToList();
|
||||
|
||||
var albums = items.OfType<MusicAlbum>().ToList();
|
||||
var episodes = items.OfType<Episode>().ToList();
|
||||
var games = items.OfType<Game>().ToList();
|
||||
var movies = items.OfType<Movie>().ToList();
|
||||
var musicVideos = items.OfType<MusicVideo>().ToList();
|
||||
var adultVideos = items.OfType<AdultVideo>().ToList();
|
||||
var boxsets = items.OfType<BoxSet>().ToList();
|
||||
var books = items.OfType<Book>().ToList();
|
||||
var songs = items.OfType<Audio>().ToList();
|
||||
var series = items.OfType<Series>().ToList();
|
||||
|
||||
|
||||
|
||||
var counts = new ItemCounts
|
||||
{
|
||||
AlbumCount = items.OfType<MusicAlbum>().Count(),
|
||||
EpisodeCount = items.OfType<Episode>().Count(),
|
||||
GameCount = items.OfType<Game>().Count(),
|
||||
AlbumCount = albums.Count,
|
||||
EpisodeCount = episodes.Count,
|
||||
GameCount = games.Count,
|
||||
GameSystemCount = items.OfType<GameSystem>().Count(),
|
||||
MovieCount = items.OfType<Movie>().Count(),
|
||||
SeriesCount = items.OfType<Series>().Count(),
|
||||
SongCount = items.OfType<Audio>().Count(),
|
||||
MovieCount = movies.Count,
|
||||
SeriesCount = series.Count,
|
||||
SongCount = songs.Count,
|
||||
TrailerCount = items.OfType<Trailer>().Count(),
|
||||
MusicVideoCount = items.OfType<MusicVideo>().Count(),
|
||||
AdultVideoCount = items.OfType<AdultVideo>().Count(),
|
||||
BoxSetCount = items.OfType<BoxSet>().Count(),
|
||||
BookCount = items.OfType<Book>().Count(),
|
||||
MusicVideoCount = musicVideos.Count,
|
||||
AdultVideoCount = adultVideos.Count,
|
||||
BoxSetCount = boxsets.Count,
|
||||
BookCount = books.Count,
|
||||
|
||||
UniqueTypes = items.Select(i => i.GetType().Name).Distinct().ToList()
|
||||
};
|
||||
|
||||
if (request.UserId.HasValue)
|
||||
{
|
||||
counts.FavoriteAlbumCount = FavoriteCount(albums, request.UserId.Value);
|
||||
counts.FavoriteEpisodeCount = FavoriteCount(episodes, request.UserId.Value);
|
||||
counts.FavoriteGameCount = FavoriteCount(games, request.UserId.Value);
|
||||
counts.FavoriteMovieCount = FavoriteCount(movies, request.UserId.Value);
|
||||
counts.FavoriteMusicVideoCount = FavoriteCount(musicVideos, request.UserId.Value);
|
||||
counts.FavoriteAdultVideoCount = FavoriteCount(adultVideos, request.UserId.Value);
|
||||
counts.FavoriteBoxSetCount = FavoriteCount(boxsets, request.UserId.Value);
|
||||
counts.FavoriteBookCount = FavoriteCount(books, request.UserId.Value);
|
||||
counts.FavoriteSongCount = FavoriteCount(songs, request.UserId.Value);
|
||||
counts.FavoriteSeriesCount = FavoriteCount(series, request.UserId.Value);
|
||||
}
|
||||
|
||||
return ToOptimizedResult(counts);
|
||||
}
|
||||
|
||||
private int FavoriteCount(IEnumerable<BaseItem> items, Guid userId)
|
||||
{
|
||||
return items.Count(i => _userDataManager.GetUserData(userId, i.GetUserDataKey()).IsFavorite);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Posts the specified request.
|
||||
/// </summary>
|
||||
|
|
|
@ -87,24 +87,6 @@ namespace MediaBrowser.Model.Configuration
|
|||
/// <value>The metadata country code.</value>
|
||||
public string MetadataCountryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the size of the TMDB fetched poster.
|
||||
/// </summary>
|
||||
/// <value>The size of the TMDB fetched poster.</value>
|
||||
public string TmdbFetchedPosterSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the size of the TMDB fetched profile.
|
||||
/// </summary>
|
||||
/// <value>The size of the TMDB fetched profile.</value>
|
||||
public string TmdbFetchedProfileSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the size of the TMDB fetched backdrop.
|
||||
/// </summary>
|
||||
/// <value>The size of the TMDB fetched backdrop.</value>
|
||||
public string TmdbFetchedBackdropSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the max backdrops.
|
||||
/// </summary>
|
||||
|
@ -274,9 +256,6 @@ namespace MediaBrowser.Model.Configuration
|
|||
MetadataRefreshDays = 30;
|
||||
PreferredMetadataLanguage = "en";
|
||||
MetadataCountryCode = "US";
|
||||
TmdbFetchedProfileSize = "original"; //w185 w45 h632 or original
|
||||
TmdbFetchedPosterSize = "original"; //w500, w342, w185 or original
|
||||
TmdbFetchedBackdropSize = "original"; //w1280, w780 or original
|
||||
DownloadMovieImages = new ImageDownloadOptions();
|
||||
DownloadSeriesImages = new ImageDownloadOptions();
|
||||
DownloadSeasonImages = new ImageDownloadOptions();
|
||||
|
|
|
@ -70,6 +70,56 @@ namespace MediaBrowser.Model.Dto
|
|||
/// <value>The unique types.</value>
|
||||
public List<string> UniqueTypes { get; set; }
|
||||
|
||||
public int FavoriteAdultVideoCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the movie count.
|
||||
/// </summary>
|
||||
/// <value>The movie count.</value>
|
||||
public int FavoriteMovieCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the series count.
|
||||
/// </summary>
|
||||
/// <value>The series count.</value>
|
||||
public int FavoriteSeriesCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the episode count.
|
||||
/// </summary>
|
||||
/// <value>The episode count.</value>
|
||||
public int FavoriteEpisodeCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the game count.
|
||||
/// </summary>
|
||||
/// <value>The game count.</value>
|
||||
public int FavoriteGameCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the song count.
|
||||
/// </summary>
|
||||
/// <value>The song count.</value>
|
||||
public int FavoriteSongCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the album count.
|
||||
/// </summary>
|
||||
/// <value>The album count.</value>
|
||||
public int FavoriteAlbumCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the music video count.
|
||||
/// </summary>
|
||||
/// <value>The music video count.</value>
|
||||
public int FavoriteMusicVideoCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the box set count.
|
||||
/// </summary>
|
||||
/// <value>The box set count.</value>
|
||||
public int FavoriteBoxSetCount { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the book count.
|
||||
/// </summary>
|
||||
/// <value>The book count.</value>
|
||||
public int FavoriteBookCount { get; set; }
|
||||
|
||||
public int FavoritePersonCount { get; set; }
|
||||
public int FavoriteArtistCount { get; set; }
|
||||
|
||||
public ItemCounts()
|
||||
{
|
||||
UniqueTypes = new List<string>();
|
||||
|
|
|
@ -246,8 +246,10 @@ namespace MediaBrowser.Providers
|
|||
image = GetImage(item, args, "show");
|
||||
}
|
||||
|
||||
var isFileSystemItem = item.LocationType == LocationType.FileSystem;
|
||||
|
||||
// Support plex/xbmc convention
|
||||
if (image == null && item is Season && item.IndexNumber.HasValue)
|
||||
if (image == null && item is Season && item.IndexNumber.HasValue && isFileSystemItem)
|
||||
{
|
||||
var seasonMarker = item.IndexNumber.Value == 0
|
||||
? "-specials"
|
||||
|
@ -275,7 +277,7 @@ namespace MediaBrowser.Providers
|
|||
}
|
||||
|
||||
// Look for a file with the same name as the item
|
||||
if (image == null)
|
||||
if (image == null && isFileSystemItem)
|
||||
{
|
||||
var name = Path.GetFileNameWithoutExtension(item.Path);
|
||||
|
||||
|
@ -305,7 +307,7 @@ namespace MediaBrowser.Providers
|
|||
if (image == null)
|
||||
{
|
||||
// Supprt xbmc conventions
|
||||
if (item is Season && item.IndexNumber.HasValue)
|
||||
if (item is Season && item.IndexNumber.HasValue && item.LocationType == LocationType.FileSystem)
|
||||
{
|
||||
var seasonMarker = item.IndexNumber.Value == 0
|
||||
? "-specials"
|
||||
|
@ -346,7 +348,7 @@ namespace MediaBrowser.Providers
|
|||
if (image == null)
|
||||
{
|
||||
// Supprt xbmc conventions
|
||||
if (item is Season && item.IndexNumber.HasValue)
|
||||
if (item is Season && item.IndexNumber.HasValue && item.LocationType == LocationType.FileSystem)
|
||||
{
|
||||
var seasonMarker = item.IndexNumber.Value == 0
|
||||
? "-specials"
|
||||
|
@ -391,7 +393,9 @@ namespace MediaBrowser.Providers
|
|||
PopulateBackdrops(item, args, backdropFiles, "background", "background-");
|
||||
PopulateBackdrops(item, args, backdropFiles, "art", "art-");
|
||||
|
||||
if (item is Season && item.IndexNumber.HasValue)
|
||||
var isFileSystemItem = item.LocationType == LocationType.FileSystem;
|
||||
|
||||
if (item is Season && item.IndexNumber.HasValue && isFileSystemItem)
|
||||
{
|
||||
var seasonMarker = item.IndexNumber.Value == 0
|
||||
? "-specials"
|
||||
|
@ -412,7 +416,10 @@ namespace MediaBrowser.Providers
|
|||
}
|
||||
}
|
||||
|
||||
PopulateBackdropsFromExtraFanart(args, backdropFiles);
|
||||
if (isFileSystemItem)
|
||||
{
|
||||
PopulateBackdropsFromExtraFanart(args, backdropFiles);
|
||||
}
|
||||
|
||||
if (backdropFiles.Count > 0)
|
||||
{
|
||||
|
|
|
@ -207,7 +207,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
{
|
||||
var tmdbSettings = await MovieDbProvider.Current.GetTmdbSettings(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var tmdbImageUrl = tmdbSettings.images.base_url + ConfigurationManager.Configuration.TmdbFetchedPosterSize;
|
||||
var tmdbImageUrl = tmdbSettings.images.base_url + "original";
|
||||
// get highest rated poster for our language
|
||||
|
||||
var postersSortedByVote = images.posters.OrderByDescending(i => i.vote_average);
|
||||
|
@ -250,7 +250,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
{
|
||||
var tmdbSettings = await MovieDbProvider.Current.GetTmdbSettings(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var tmdbImageUrl = tmdbSettings.images.base_url + ConfigurationManager.Configuration.TmdbFetchedBackdropSize;
|
||||
var tmdbImageUrl = tmdbSettings.images.base_url + "original";
|
||||
|
||||
for (var i = 0; i < images.backdrops.Count; i++)
|
||||
{
|
||||
|
|
|
@ -73,9 +73,9 @@ namespace MediaBrowser.Providers.Movies
|
|||
|
||||
progress.Report(80);
|
||||
|
||||
innerProgress = new ActionableProgress<double>();
|
||||
innerProgress.RegisterAction(pct => progress.Report(80 + pct * .2));
|
||||
await Run(innerProgress, true, cancellationToken).ConfigureAwait(false);
|
||||
//innerProgress = new ActionableProgress<double>();
|
||||
//innerProgress.RegisterAction(pct => progress.Report(80 + pct * .2));
|
||||
//await Run(innerProgress, true, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
progress.Report(100);
|
||||
}
|
||||
|
|
|
@ -360,7 +360,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
{
|
||||
var tmdbSettings = await MovieDbProvider.Current.GetTmdbSettings(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await DownloadAndSaveImage(person, tmdbSettings.images.base_url + ConfigurationManager.Configuration.TmdbFetchedProfileSize + profile.file_path,
|
||||
await DownloadAndSaveImage(person, tmdbSettings.images.base_url + "original" + profile.file_path,
|
||||
MimeTypes.GetMimeType(profile.file_path), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.227</version>
|
||||
<version>3.0.228</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.227" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.228" />
|
||||
<dependency id="NLog" version="2.1.0" />
|
||||
<dependency id="ServiceStack.Text" version="3.9.58" />
|
||||
<dependency id="SimpleInjector" version="2.3.2" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.227</version>
|
||||
<version>3.0.228</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.227</version>
|
||||
<version>3.0.228</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.227" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.228" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Reference in New Issue
Block a user