From 49971e837bff1fa27680d83bfe5ca4ebe84ef581 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sun, 22 Sep 2024 18:27:48 -0700 Subject: [PATCH] Remove deprecated client-side sort --- .../api/navidrome/navidrome-controller.ts | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/renderer/api/navidrome/navidrome-controller.ts b/src/renderer/api/navidrome/navidrome-controller.ts index bea42d98..6b2fd353 100644 --- a/src/renderer/api/navidrome/navidrome-controller.ts +++ b/src/renderer/api/navidrome/navidrome-controller.ts @@ -50,7 +50,6 @@ import { SimilarSongsArgs, Song, MoveItemArgs, - SongListSort, } from '../types'; import { VersionInfo, getFeatures, hasFeature } from '/@/renderer/api/utils'; import { ServerFeature, ServerFeatures } from '/@/renderer/api/features-types'; @@ -286,34 +285,6 @@ const getSongList = async (args: SongListArgs): Promise => { throw new Error('Failed to get song list'); } - if ( - (query.sortBy === SongListSort.ALBUM || query.sortBy === SongListSort.ALBUM_ARTIST) && - !query.limit - ) { - const isAlbumArtist = query.sortBy === SongListSort.ALBUM_ARTIST; - - res.body.data.sort((a, b) => { - if (isAlbumArtist) { - const albumDiff = a.album.localeCompare(b.album); - if (albumDiff !== 0) { - return albumDiff; - } - } - - const discDiff = a.discNumber - b.discNumber; - if (discDiff !== 0) { - return discDiff; - } - - const trackDiff = a.trackNumber - b.trackNumber; - if (trackDiff !== 0) { - return trackDiff; - } - - return a.title.localeCompare(b.title); - }); - } - return { items: res.body.data.map((song) => ndNormalize.song(song, apiClientProps.server, '', query.imageSize),