modify LatestMediaViewModel.requestLatestMedia params
fix build error
This commit is contained in:
parent
fad8f14a21
commit
a46ed45925
|
@ -16,13 +16,11 @@ struct LatestMediaView: View {
|
||||||
ScrollView(.horizontal, showsIndicators: false) {
|
ScrollView(.horizontal, showsIndicators: false) {
|
||||||
LazyHStack {
|
LazyHStack {
|
||||||
ForEach(viewModel.items, id: \.id) { item in
|
ForEach(viewModel.items, id: \.id) { item in
|
||||||
if item.type == "Series" || item.type == "Movie" {
|
|
||||||
Button {
|
Button {
|
||||||
homeRouter.route(to: \.item, item)
|
homeRouter.route(to: \.item, item)
|
||||||
} label: {
|
} label: {
|
||||||
PortraitItemView(item: item)
|
PortraitItemView(item: item)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}.padding(.trailing, 16)
|
}.padding(.trailing, 16)
|
||||||
}.padding(.leading, 20)
|
}.padding(.leading, 20)
|
||||||
}.frame(height: 200)
|
}.frame(height: 200)
|
||||||
|
|
|
@ -26,7 +26,8 @@ final class LatestMediaViewModel: ViewModel {
|
||||||
|
|
||||||
func requestLatestMedia() {
|
func requestLatestMedia() {
|
||||||
LogManager.shared.log.debug("Requesting latest media for user id \(SessionManager.current.user.user_id ?? "NIL")")
|
LogManager.shared.log.debug("Requesting latest media for user id \(SessionManager.current.user.user_id ?? "NIL")")
|
||||||
UserLibraryAPI.getLatestMedia(userId: SessionManager.current.user.user_id!, parentId: libraryID,
|
UserLibraryAPI.getLatestMedia(userId: SessionManager.current.user.user_id!,
|
||||||
|
parentId: libraryID,
|
||||||
fields: [
|
fields: [
|
||||||
.primaryImageAspectRatio,
|
.primaryImageAspectRatio,
|
||||||
.seriesPrimaryImage,
|
.seriesPrimaryImage,
|
||||||
|
@ -35,6 +36,7 @@ final class LatestMediaViewModel: ViewModel {
|
||||||
.genres,
|
.genres,
|
||||||
.people
|
.people
|
||||||
],
|
],
|
||||||
|
includeItemTypes: ["Series", "Movie"],
|
||||||
enableUserData: true, limit: 12)
|
enableUserData: true, limit: 12)
|
||||||
.trackActivity(loading)
|
.trackActivity(loading)
|
||||||
.sink(receiveCompletion: { [weak self] completion in
|
.sink(receiveCompletion: { [weak self] completion in
|
||||||
|
|
Loading…
Reference in New Issue