1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

apply suggestion

This commit is contained in:
grafixeyehero 2023-10-20 19:48:02 +03:00
parent 561293b2a7
commit f6e9b1c997

View file

@ -25,23 +25,21 @@ type SortOptionsMapping = {
[key: string]: SortOption[]; [key: string]: SortOption[];
}; };
const getMoviesOrFavoritesOptions = () => { const movieOrFavoriteOptions = [
return [ { label: 'Name', value: ItemSortBy.SortName },
{ label: 'Name', value: ItemSortBy.SortName }, { label: 'OptionRandom', value: ItemSortBy.Random },
{ label: 'OptionRandom', value: ItemSortBy.Random }, { label: 'OptionImdbRating', value: ItemSortBy.CommunityRating },
{ label: 'OptionImdbRating', value: ItemSortBy.CommunityRating }, { label: 'OptionCriticRating', value: ItemSortBy.CriticRating },
{ label: 'OptionCriticRating', value: ItemSortBy.CriticRating }, { label: 'OptionDateAdded', value: ItemSortBy.DateCreated },
{ label: 'OptionDateAdded', value: ItemSortBy.DateCreated }, { label: 'OptionDatePlayed', value: ItemSortBy.DatePlayed },
{ label: 'OptionDatePlayed', value: ItemSortBy.DatePlayed }, { label: 'OptionParentalRating', value: ItemSortBy.OfficialRating },
{ label: 'OptionParentalRating', value: ItemSortBy.OfficialRating }, { label: 'OptionPlayCount', value: ItemSortBy.PlayCount },
{ label: 'OptionPlayCount', value: ItemSortBy.PlayCount }, { label: 'OptionReleaseDate', value: ItemSortBy.PremiereDate },
{ label: 'OptionReleaseDate', value: ItemSortBy.PremiereDate }, { label: 'Runtime', value: ItemSortBy.Runtime }
{ label: 'Runtime', value: ItemSortBy.Runtime } ];
];
};
const sortOptionsMapping: SortOptionsMapping = { const sortOptionsMapping: SortOptionsMapping = {
[LibraryTab.Movies]: getMoviesOrFavoritesOptions(), [LibraryTab.Movies]: movieOrFavoriteOptions,
[LibraryTab.Trailers]: [ [LibraryTab.Trailers]: [
{ label: 'Name', value: ItemSortBy.SortName }, { label: 'Name', value: ItemSortBy.SortName },
{ label: 'OptionImdbRating', value: ItemSortBy.CommunityRating }, { label: 'OptionImdbRating', value: ItemSortBy.CommunityRating },
@ -51,7 +49,7 @@ const sortOptionsMapping: SortOptionsMapping = {
{ label: 'OptionPlayCount', value: ItemSortBy.PlayCount }, { label: 'OptionPlayCount', value: ItemSortBy.PlayCount },
{ label: 'OptionReleaseDate', value: ItemSortBy.PremiereDate } { label: 'OptionReleaseDate', value: ItemSortBy.PremiereDate }
], ],
[LibraryTab.Favorites]: getMoviesOrFavoritesOptions(), [LibraryTab.Favorites]: movieOrFavoriteOptions,
[LibraryTab.Series]: [ [LibraryTab.Series]: [
{ label: 'Name', value: ItemSortBy.SortName }, { label: 'Name', value: ItemSortBy.SortName },
{ label: 'OptionRandom', value: ItemSortBy.Random }, { label: 'OptionRandom', value: ItemSortBy.Random },