mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 14:58:36 +01:00
improve genre displays
This commit is contained in:
@@ -408,12 +408,19 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
|
||||
private void SetItemByNameInfo(BaseItem item, BaseItemDto dto, List<BaseItem> taggedItems, User user = null)
|
||||
{
|
||||
if (item is MusicArtist || item is MusicGenre)
|
||||
if (item is MusicArtist)
|
||||
{
|
||||
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
|
||||
dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo);
|
||||
dto.SongCount = taggedItems.Count(i => i is Audio);
|
||||
}
|
||||
else if (item is MusicGenre)
|
||||
{
|
||||
dto.ArtistCount = taggedItems.Count(i => i is MusicArtist);
|
||||
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
|
||||
dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo);
|
||||
dto.SongCount = taggedItems.Count(i => i is Audio);
|
||||
}
|
||||
else if (item is GameGenre)
|
||||
{
|
||||
dto.GameCount = taggedItems.Count(i => i is Game);
|
||||
@@ -422,6 +429,7 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
{
|
||||
// This populates them all and covers Genre, Person, Studio, Year
|
||||
|
||||
dto.ArtistCount = taggedItems.Count(i => i is MusicArtist);
|
||||
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
|
||||
dto.EpisodeCount = taggedItems.Count(i => i is Episode);
|
||||
dto.GameCount = taggedItems.Count(i => i is Game);
|
||||
|
||||
@@ -1223,7 +1223,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
.Select(dir => GetVirtualFolderInfo(dir, topLibraryFolders));
|
||||
}
|
||||
|
||||
private VirtualFolderInfo GetVirtualFolderInfo(string dir, List<BaseItem> collectionFolders)
|
||||
private VirtualFolderInfo GetVirtualFolderInfo(string dir, List<BaseItem> allCollectionFolders)
|
||||
{
|
||||
var info = new VirtualFolderInfo
|
||||
{
|
||||
@@ -1237,7 +1237,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
CollectionType = GetCollectionType(dir)
|
||||
};
|
||||
|
||||
var libraryFolder = collectionFolders.FirstOrDefault(i => string.Equals(i.Path, dir, StringComparison.OrdinalIgnoreCase));
|
||||
var libraryFolder = allCollectionFolders.FirstOrDefault(i => string.Equals(i.Path, dir, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (libraryFolder != null && libraryFolder.HasImage(ImageType.Primary))
|
||||
{
|
||||
@@ -1249,6 +1249,12 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
info.ItemId = libraryFolder.Id.ToString("N");
|
||||
}
|
||||
|
||||
var collectionFolder = libraryFolder as CollectionFolder;
|
||||
if (collectionFolder != null)
|
||||
{
|
||||
info.LibraryOptions = collectionFolder.GetLibraryOptions();
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -2426,13 +2432,13 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
options.AudioFileExtensions.Remove(".m3u");
|
||||
options.AudioFileExtensions.Remove(".wpl");
|
||||
|
||||
if (!libraryOptions.EnableAudioArchiveFiles)
|
||||
if (!libraryOptions.EnableArchiveMediaFiles)
|
||||
{
|
||||
options.AudioFileExtensions.Remove(".rar");
|
||||
options.AudioFileExtensions.Remove(".zip");
|
||||
}
|
||||
|
||||
if (!libraryOptions.EnableVideoArchiveFiles)
|
||||
if (!libraryOptions.EnableArchiveMediaFiles)
|
||||
{
|
||||
options.VideoFileExtensions.Remove(".rar");
|
||||
options.VideoFileExtensions.Remove(".zip");
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CommonIO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using CommonIO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using CommonIO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ using CommonIO;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Power;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
@@ -3975,7 +3975,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
AlbumArtistStartsWithOrGreater = query.AlbumArtistStartsWithOrGreater,
|
||||
Tags = query.Tags,
|
||||
OfficialRatings = query.OfficialRatings,
|
||||
Genres = query.GenreIds,
|
||||
GenreIds = query.GenreIds,
|
||||
Genres = query.Genres,
|
||||
Years = query.Years
|
||||
};
|
||||
|
||||
@@ -4128,6 +4129,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
counts.AlbumCount = value;
|
||||
}
|
||||
else if (string.Equals(typeName, typeof(MusicArtist).FullName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
counts.ArtistCount = value;
|
||||
}
|
||||
else if (string.Equals(typeName, typeof(Audio).FullName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
counts.SongCount = value;
|
||||
|
||||
Reference in New Issue
Block a user