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

Use sort options based on view type

This commit is contained in:
grafixeyehero 2023-10-14 20:07:53 +03:00
parent 216e01aa55
commit 561293b2a7
2 changed files with 94 additions and 38 deletions

View file

@ -144,6 +144,14 @@ export const getSettingsKey = (viewType: LibraryTab, parentId: ParentId) => {
return `${viewType} - ${parentId}`;
};
export const getDefaultSortBy = (viewType: LibraryTab) => {
if (viewType === LibraryTab.Episodes ) {
return ItemSortBy.SeriesSortName;
}
return ItemSortBy.SortName;
};
export const getDefaultLibraryViewSettings = (viewType: LibraryTab): LibraryViewSettings => {
return {
ShowTitle: true,
@ -151,7 +159,7 @@ export const getDefaultLibraryViewSettings = (viewType: LibraryTab): LibraryView
ViewMode: viewType === LibraryTab.Songs ? ViewMode.ListView : ViewMode.GridView,
ImageType: viewType === LibraryTab.Networks ? ImageType.Thumb : ImageType.Primary,
CardLayout: false,
SortBy: ItemSortBy.SortName,
SortBy: getDefaultSortBy(viewType),
SortOrder: SortOrder.Ascending,
StartIndex: 0
};