mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-19 04:34:18 +01:00
update dlna genre views
This commit is contained in:
@@ -69,7 +69,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
if (query.IncludeItemTypes.Length == 0)
|
||||
{
|
||||
query.IncludeItemTypes = new[] { typeof(Audio).Name, typeof(MusicVideo).Name, typeof(MusicAlbum).Name };
|
||||
query.ArtistNames = new[] { Name };
|
||||
query.ArtistIds = new[] { Id.ToString("N") };
|
||||
}
|
||||
|
||||
return LibraryManager.GetItemList(query);
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
public bool? HasTrailer { get; set; }
|
||||
public bool? HasParentalRating { get; set; }
|
||||
|
||||
public string[] Studios { get; set; }
|
||||
public string[] StudioIds { get; set; }
|
||||
public string[] GenreIds { get; set; }
|
||||
public ImageType[] ImageTypes { get; set; }
|
||||
@@ -144,7 +143,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
public string[] AlbumNames { get; set; }
|
||||
public string[] ArtistNames { get; set; }
|
||||
public string[] ArtistIds { get; set; }
|
||||
public string[] ExcludeArtistIds { get; set; }
|
||||
public string AncestorWithPresentationUniqueKey { get; set; }
|
||||
public string SeriesPresentationUniqueKey { get; set; }
|
||||
@@ -203,7 +202,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
DtoOptions = new DtoOptions();
|
||||
AlbumNames = new string[] { };
|
||||
ArtistNames = new string[] { };
|
||||
ArtistIds = new string[] { };
|
||||
ExcludeArtistIds = new string[] { };
|
||||
ExcludeProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
@@ -216,7 +215,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
IncludeItemTypes = new string[] { };
|
||||
ExcludeItemTypes = new string[] { };
|
||||
Genres = new string[] { };
|
||||
Studios = new string[] { };
|
||||
StudioIds = new string[] { };
|
||||
GenreIds = new string[] { };
|
||||
ImageTypes = new ImageType[] { };
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public IEnumerable<BaseItem> GetTaggedItems(InternalItemsQuery query)
|
||||
{
|
||||
query.Studios = new[] { Name };
|
||||
query.StudioIds = new[] { Id.ToString("N") };
|
||||
|
||||
return LibraryManager.GetItemList(query);
|
||||
}
|
||||
|
||||
@@ -248,19 +248,25 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
|
||||
public IEnumerable<Season> GetSeasons(User user)
|
||||
{
|
||||
var query = new InternalItemsQuery(user);
|
||||
|
||||
SetSeasonQueryOptions(query, user);
|
||||
|
||||
return LibraryManager.GetItemList(query).Cast<Season>();
|
||||
}
|
||||
|
||||
private void SetSeasonQueryOptions(InternalItemsQuery query, User user)
|
||||
{
|
||||
var config = user.Configuration;
|
||||
|
||||
var enableSeriesPresentationKey = ConfigurationManager.Configuration.EnableSeriesPresentationUniqueKey;
|
||||
var seriesKey = GetUniqueSeriesKey(this);
|
||||
|
||||
var query = new InternalItemsQuery(user)
|
||||
{
|
||||
AncestorWithPresentationUniqueKey = enableSeriesPresentationKey ? null : seriesKey,
|
||||
SeriesPresentationUniqueKey = enableSeriesPresentationKey ? seriesKey : null,
|
||||
IncludeItemTypes = new[] { typeof(Season).Name },
|
||||
SortBy = new[] { ItemSortBy.SortName }
|
||||
};
|
||||
query.AncestorWithPresentationUniqueKey = enableSeriesPresentationKey ? null : seriesKey;
|
||||
query.SeriesPresentationUniqueKey = enableSeriesPresentationKey ? seriesKey : null;
|
||||
query.IncludeItemTypes = new[] { typeof(Season).Name };
|
||||
query.SortBy = new[] {ItemSortBy.SortName};
|
||||
|
||||
if (!config.DisplayMissingEpisodes && !config.DisplayUnairedEpisodes)
|
||||
{
|
||||
@@ -274,8 +280,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
query.IsVirtualUnaired = false;
|
||||
}
|
||||
|
||||
return LibraryManager.GetItemList(query).Cast<Season>();
|
||||
}
|
||||
|
||||
protected override Task<QueryResult<BaseItem>> GetItemsInternal(InternalItemsQuery query)
|
||||
@@ -306,11 +310,9 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
return Task.FromResult(LibraryManager.GetItemsResult(query));
|
||||
}
|
||||
|
||||
Func<BaseItem, bool> filter = i => UserViewBuilder.Filter(i, user, query, UserDataManager, LibraryManager);
|
||||
SetSeasonQueryOptions(query, user);
|
||||
|
||||
var items = GetSeasons(user).Where(filter);
|
||||
var result = PostFilterAndSort(items, query, false, true);
|
||||
return Task.FromResult(result);
|
||||
return Task.FromResult(LibraryManager.GetItemsResult(query));
|
||||
}
|
||||
|
||||
public IEnumerable<Episode> GetEpisodes(User user)
|
||||
|
||||
@@ -1005,11 +1005,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return false;
|
||||
}
|
||||
|
||||
if (request.Studios.Length > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (request.StudioIds.Length > 0)
|
||||
{
|
||||
return false;
|
||||
@@ -1514,12 +1509,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return false;
|
||||
}
|
||||
|
||||
// Apply studio filter
|
||||
if (query.Studios.Length > 0 && !query.Studios.Any(v => item.Studios.Contains(v, StringComparer.OrdinalIgnoreCase)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Apply studio filter
|
||||
if (query.StudioIds.Length > 0 && !query.StudioIds.Any(id =>
|
||||
{
|
||||
@@ -1733,14 +1722,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
// Artists
|
||||
if (query.ArtistNames.Length > 0)
|
||||
if (query.ArtistIds.Length > 0)
|
||||
{
|
||||
var audio = item as IHasArtist;
|
||||
|
||||
if (!(audio != null && query.ArtistNames.Any(audio.HasAnyArtist)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//if (!(audio != null && query.ArtistNames.Any(audio.HasAnyArtist)))
|
||||
//{
|
||||
// return false;
|
||||
//}
|
||||
}
|
||||
|
||||
// Albums
|
||||
|
||||
Reference in New Issue
Block a user