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:
parent
216e01aa55
commit
561293b2a7
2 changed files with 94 additions and 38 deletions
|
@ -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
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue