mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-10 20:48:35 -06:00
Horizontal card list adjustments
Adding recently added albums to discover
This commit is contained in:
@@ -2,6 +2,27 @@ import { BaseItemDto, BaseItemKind, ItemSortBy, SortOrder } from "@jellyfin/sdk/
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { QueryConfig } from "../query.config";
|
||||
import Client from "../../client";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api";
|
||||
|
||||
export function fetchRecentlyAdded(offset?: number | undefined) : Promise<BaseItemDto[]> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
if (!!!Client.api)
|
||||
return reject("Client not set")
|
||||
|
||||
if (!!!Client.library)
|
||||
return reject("Library not set")
|
||||
else
|
||||
getUserLibraryApi(Client.api)
|
||||
.getLatestMedia({
|
||||
parentId: Client.library.musicLibraryId,
|
||||
limit: QueryConfig.limits.recents,
|
||||
})
|
||||
.then(({ data }) => {
|
||||
resolve(data);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchRecentlyPlayed(offset?: number | undefined): Promise<BaseItemDto[]> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user