From 38ce9986e590392667fae7c8119aa1057e95cd23 Mon Sep 17 00:00:00 2001 From: Lei Nelissen Date: Sun, 21 Jul 2024 22:45:07 +0200 Subject: [PATCH] fix: fine-tune default orderings fixes #229 --- src/utility/JellyfinApi/album.ts | 2 +- src/utility/JellyfinApi/playlist.ts | 2 +- src/utility/JellyfinApi/search.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utility/JellyfinApi/album.ts b/src/utility/JellyfinApi/album.ts index c832afd5..921f1e3c 100644 --- a/src/utility/JellyfinApi/album.ts +++ b/src/utility/JellyfinApi/album.ts @@ -59,7 +59,7 @@ export async function retrieveRecentAlbums(numberOfAlbums = 24) { export async function retrieveAlbumTracks(ItemId: string) { const singleAlbumOptions = { ParentId: ItemId, - SortBy: 'SortName', + SortBy: 'IndexNumber,SortName', }; const singleAlbumParams = new URLSearchParams(singleAlbumOptions).toString(); diff --git a/src/utility/JellyfinApi/playlist.ts b/src/utility/JellyfinApi/playlist.ts index 1662e8e0..27c1a51e 100644 --- a/src/utility/JellyfinApi/playlist.ts +++ b/src/utility/JellyfinApi/playlist.ts @@ -28,7 +28,7 @@ export async function retrieveAllPlaylists() { export async function retrievePlaylistTracks(ItemId: string) { const credentials = asyncFetchStore().getState().settings.jellyfin; const singlePlaylistOptions = { - SortBy: 'SortName', + SortBy: 'IndexNumber,SortName', UserId: credentials?.user_id || '', }; const singlePlaylistParams = new URLSearchParams(singlePlaylistOptions).toString(); diff --git a/src/utility/JellyfinApi/search.ts b/src/utility/JellyfinApi/search.ts index 33a1b7b3..8da8043a 100644 --- a/src/utility/JellyfinApi/search.ts +++ b/src/utility/JellyfinApi/search.ts @@ -3,7 +3,7 @@ import { fetchApi } from './lib'; const searchParams = { IncludeItemTypes: 'Audio,MusicAlbum', - SortBy: 'Album,SortName', + SortBy: 'SearchScore,Album,SortName', SortOrder: 'Ascending', Recursive: 'true', };