mirror of
https://github.com/jellyfin/Swiftfin.git
synced 2024-11-27 08:10:23 +00:00
Support folder-type libraries on tvOS
And fixed a bug in LibraryListView where proper parent ID was not passed to LibraryViewModel.
This commit is contained in:
parent
3f52223be5
commit
87331444be
@ -62,7 +62,7 @@ struct ItemView: View {
|
||||
} else {
|
||||
SeriesItemView(viewModel: SeriesItemViewModel(item: item))
|
||||
}
|
||||
case .boxset:
|
||||
case .boxset, .folder:
|
||||
CinematicCollectionItemView(viewModel: CollectionItemViewModel(item: item))
|
||||
default:
|
||||
Text(L10n.notImplementedYetWithType(item.type ?? ""))
|
||||
|
@ -81,7 +81,8 @@ struct LibraryListView: View {
|
||||
}
|
||||
} else {
|
||||
Button {
|
||||
self.libraryListRouter.route(to: \.library, (viewModel: LibraryViewModel(), title: library.name ?? ""))
|
||||
self.libraryListRouter.route(to: \.library,
|
||||
(viewModel: LibraryViewModel(parentID: library.id), title: library.name ?? ""))
|
||||
}
|
||||
label: {
|
||||
ZStack {
|
||||
|
@ -56,17 +56,15 @@ struct LibraryView: View {
|
||||
} cell: { _, cell in
|
||||
GeometryReader { _ in
|
||||
if let item = cell.item {
|
||||
if item.type != "Folder" {
|
||||
Button {
|
||||
libraryRouter.route(to: \.modalItem, item)
|
||||
} label: {
|
||||
PortraitItemElement(item: item)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
.onAppear {
|
||||
if item == viewModel.items.last && viewModel.hasNextPage {
|
||||
viewModel.requestNextPageAsync()
|
||||
}
|
||||
Button {
|
||||
libraryRouter.route(to: \.modalItem, item)
|
||||
} label: {
|
||||
PortraitItemElement(item: item)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
.onAppear {
|
||||
if item == viewModel.items.last && viewModel.hasNextPage {
|
||||
viewModel.requestNextPageAsync()
|
||||
}
|
||||
}
|
||||
} else if cell.loadingCell {
|
||||
|
Loading…
Reference in New Issue
Block a user