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,
|
parentId: viewModel.id,
|
||||||
limit: 9,
|
sortBy: [ItemSortBy.datelastcontentadded, ItemSortBy.datecreated, ItemSortBy.sortname],
|
||||||
imageTypeLimit: 1,
|
sortOrder: [SortOrder.descending],
|
||||||
includeItemTypes: viewModel.collectionType.itemKinds.map((e) => e.dtoKind).toList(),
|
includeItemTypes: viewModel.collectionType.itemKinds.map((e) => e.dtoKind).toList(),
|
||||||
);
|
);
|
||||||
newRecommendations = [
|
newRecommendations = [
|
||||||
...newRecommendations,
|
...newRecommendations,
|
||||||
RecommendedModel(
|
RecommendedModel(
|
||||||
name: const Latest(),
|
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,
|
type: null,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -698,6 +698,8 @@ class JellyService {
|
||||||
|
|
||||||
Future<Response<BaseItemDtoQueryResult>> usersUserIdItemsGet({
|
Future<Response<BaseItemDtoQueryResult>> usersUserIdItemsGet({
|
||||||
String? parentId,
|
String? parentId,
|
||||||
|
List<ItemSortBy>? sortBy,
|
||||||
|
List<SortOrder>? sortOrder,
|
||||||
bool? recursive,
|
bool? recursive,
|
||||||
List<BaseItemKind>? includeItemTypes,
|
List<BaseItemKind>? includeItemTypes,
|
||||||
}) async {
|
}) async {
|
||||||
|
|
@ -705,6 +707,8 @@ class JellyService {
|
||||||
parentId: parentId,
|
parentId: parentId,
|
||||||
userId: account?.id,
|
userId: account?.id,
|
||||||
recursive: recursive,
|
recursive: recursive,
|
||||||
|
sortBy: sortBy,
|
||||||
|
sortOrder: sortOrder,
|
||||||
includeItemTypes: includeItemTypes,
|
includeItemTypes: includeItemTypes,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue