mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
fixes #945 - Add genre views to dlna
This commit is contained in:
@@ -148,11 +148,16 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
.ThenBy(i => i.SortName);
|
||||
}
|
||||
|
||||
public Task<UserView> GetUserView(string name, string parentId, string type, User user, string sortName, CancellationToken cancellationToken)
|
||||
{
|
||||
return _libraryManager.GetSpecialFolder(user, name, parentId, type, sortName, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<UserView> GetUserView(string parentId, string type, User user, string sortName, CancellationToken cancellationToken)
|
||||
{
|
||||
var name = _localizationManager.GetLocalizedString("ViewType" + type);
|
||||
|
||||
return _libraryManager.GetSpecialFolder(user, name, parentId, type, sortName, cancellationToken);
|
||||
return GetUserView(name, parentId, type, user, sortName, cancellationToken);
|
||||
}
|
||||
|
||||
public Task<UserView> GetUserView(string type, string sortName, CancellationToken cancellationToken)
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
"LabelPremiereProgram": "PREMIERE",
|
||||
"LabelHDProgram": "HD",
|
||||
"HeaderChangeFolderType": "Change Folder Type",
|
||||
"HeaderChangeFolderTypeHelp": "To change the folder type, please remove and rebuild the collection with the new type.",
|
||||
"HeaderChangeFolderTypeHelp": "To change the type, please remove and rebuild the folder with the new type.",
|
||||
"HeaderAlert": "Alert",
|
||||
"MessagePleaseRestart": "Please restart to finish updating.",
|
||||
"ButtonRestart": "Restart",
|
||||
|
||||
@@ -145,9 +145,11 @@
|
||||
"OptionBudget": "Budget",
|
||||
"OptionRevenue": "Revenue",
|
||||
"OptionPoster": "Poster",
|
||||
"OptionPosterCard": "Poster card",
|
||||
"OptionBackdrop": "Backdrop",
|
||||
"OptionTimeline": "Timeline",
|
||||
"OptionThumb": "Thumb",
|
||||
"OptionThumbCard": "Thumb card",
|
||||
"OptionBanner": "Banner",
|
||||
"OptionCriticRating": "Critic Rating",
|
||||
"OptionVideoBitrate": "Video Bitrate",
|
||||
@@ -455,7 +457,7 @@
|
||||
"LinkApiDocumentation": "Api Documentation",
|
||||
"LabelFriendlyServerName": "Friendly server name:",
|
||||
"LabelFriendlyServerNameHelp": "This name will be used to identify this server. If left blank, the computer name will be used.",
|
||||
"LabelPreferredDisplayLanguage": "Preferred display language",
|
||||
"LabelPreferredDisplayLanguage": "Preferred display language:",
|
||||
"LabelPreferredDisplayLanguageHelp": "Translating Media Browser is an ongoing project and is not yet complete.",
|
||||
"LabelReadHowYouCanContribute": "Read about how you can contribute.",
|
||||
"HeaderNewCollection": "New Collection",
|
||||
@@ -847,6 +849,8 @@
|
||||
"ViewTypeTvShows": "TV",
|
||||
"ViewTypeGames": "Games",
|
||||
"ViewTypeMusic": "Music",
|
||||
"ViewTypeMusicGenres": "Genres",
|
||||
"ViewTypeMusicArtists": "Artists",
|
||||
"ViewTypeBoxSets": "Collections",
|
||||
"ViewTypeChannels": "Channels",
|
||||
"ViewTypeLiveTV": "Live TV",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
@@ -8,6 +9,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MoreLinq;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Music
|
||||
{
|
||||
@@ -36,7 +38,42 @@ namespace MediaBrowser.Server.Implementations.Music
|
||||
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
return GetFinalItems(result.Items.Where(i => i.HasImage(ImageType.Primary)).ToList());
|
||||
var items = result.Items.Select(i =>
|
||||
{
|
||||
var episode = i as Episode;
|
||||
if (episode != null)
|
||||
{
|
||||
var series = episode.Series;
|
||||
if (series != null)
|
||||
{
|
||||
return series;
|
||||
}
|
||||
var episodeSeason = episode.Season;
|
||||
if (episodeSeason != null)
|
||||
{
|
||||
return episodeSeason;
|
||||
}
|
||||
|
||||
return episode;
|
||||
}
|
||||
|
||||
var season = i as Season;
|
||||
if (season != null)
|
||||
{
|
||||
var series = season.Series;
|
||||
if (series != null)
|
||||
{
|
||||
return series;
|
||||
}
|
||||
|
||||
return season;
|
||||
}
|
||||
|
||||
return i;
|
||||
|
||||
}).DistinctBy(i => i.Id);
|
||||
|
||||
return GetFinalItems(items.Where(i => i.HasImage(ImageType.Primary)).ToList());
|
||||
}
|
||||
|
||||
protected override bool Supports(IHasImages item)
|
||||
@@ -50,6 +87,7 @@ namespace MediaBrowser.Server.Implementations.Music
|
||||
SpecialFolder.TvFavoriteEpisodes,
|
||||
SpecialFolder.TvFavoriteSeries,
|
||||
SpecialFolder.TvGenres,
|
||||
SpecialFolder.TvGenre,
|
||||
SpecialFolder.TvLatest,
|
||||
SpecialFolder.TvNextUp,
|
||||
SpecialFolder.TvResume,
|
||||
@@ -58,12 +96,14 @@ namespace MediaBrowser.Server.Implementations.Music
|
||||
SpecialFolder.MovieCollections,
|
||||
SpecialFolder.MovieFavorites,
|
||||
SpecialFolder.MovieGenres,
|
||||
SpecialFolder.MovieGenre,
|
||||
SpecialFolder.MovieLatest,
|
||||
SpecialFolder.MovieMovies,
|
||||
SpecialFolder.MovieResume,
|
||||
|
||||
SpecialFolder.GameFavorites,
|
||||
SpecialFolder.GameGenres,
|
||||
SpecialFolder.GameGenre,
|
||||
SpecialFolder.GameSystems,
|
||||
SpecialFolder.LatestGames,
|
||||
SpecialFolder.RecentlyPlayedGames,
|
||||
@@ -72,6 +112,7 @@ namespace MediaBrowser.Server.Implementations.Music
|
||||
SpecialFolder.MusicAlbumArtists,
|
||||
SpecialFolder.MusicAlbums,
|
||||
SpecialFolder.MusicGenres,
|
||||
SpecialFolder.MusicGenre,
|
||||
SpecialFolder.MusicLatest,
|
||||
SpecialFolder.MusicSongs,
|
||||
SpecialFolder.MusicFavorites,
|
||||
|
||||
Reference in New Issue
Block a user