mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: avoid /Latest endpoint to improve performance
This commit is contained in:
parent
fdb3178f49
commit
afe8454359
2 changed files with 8 additions and 4 deletions
|
|
@ -161,17 +161,17 @@ class LibraryScreen extends _$LibraryScreen {
|
|||
];
|
||||
}
|
||||
|
||||
final latest = await api.usersUserIdItemsLatestGet(
|
||||
final latest = await api.usersUserIdItemsGet(
|
||||
parentId: viewModel.id,
|
||||
limit: 9,
|
||||
imageTypeLimit: 1,
|
||||
sortBy: [ItemSortBy.datelastcontentadded, ItemSortBy.datecreated, ItemSortBy.sortname],
|
||||
sortOrder: [SortOrder.descending],
|
||||
includeItemTypes: viewModel.collectionType.itemKinds.map((e) => e.dtoKind).toList(),
|
||||
);
|
||||
newRecommendations = [
|
||||
...newRecommendations,
|
||||
RecommendedModel(
|
||||
name: const Latest(),
|
||||
posters: latest.body?.map((e) => ItemBaseModel.fromBaseDto(e, ref)).toList() ?? [],
|
||||
posters: latest.body?.items?.map((e) => ItemBaseModel.fromBaseDto(e, ref)).toList() ?? [],
|
||||
type: null,
|
||||
),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -698,6 +698,8 @@ class JellyService {
|
|||
|
||||
Future<Response<BaseItemDtoQueryResult>> usersUserIdItemsGet({
|
||||
String? parentId,
|
||||
List<ItemSortBy>? sortBy,
|
||||
List<SortOrder>? sortOrder,
|
||||
bool? recursive,
|
||||
List<BaseItemKind>? includeItemTypes,
|
||||
}) async {
|
||||
|
|
@ -705,6 +707,8 @@ class JellyService {
|
|||
parentId: parentId,
|
||||
userId: account?.id,
|
||||
recursive: recursive,
|
||||
sortBy: sortBy,
|
||||
sortOrder: sortOrder,
|
||||
includeItemTypes: includeItemTypes,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue