mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-03 09:10:13 -05:00
prevent miniplayer flickering when queue is filled
miniplayer improvements other stuff
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Api } from "@jellyfin/sdk";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { QueryKeys } from "../../enums/query-keys";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api";
|
||||
import { ItemSortBy } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
|
||||
export const useAlbumTracks = (albumId: string, api: Api) => useQuery({
|
||||
queryKey: [QueryKeys.AlbumTracks, albumId, api],
|
||||
queryFn: ({ queryKey }) => {
|
||||
return getItemsApi(queryKey[2] as Api).getItems({
|
||||
parentId: albumId,
|
||||
sortBy: [
|
||||
ItemSortBy.ParentIndexNumber,
|
||||
ItemSortBy.IndexNumber,
|
||||
ItemSortBy.SortName
|
||||
]
|
||||
})
|
||||
.then((response) => {
|
||||
return response.data.Items ? response.data.Items! : [];
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user