Merge branch 'main' into ios-video-player-refactor
This commit is contained in:
commit
cd6f02d5f1
|
@ -10,7 +10,7 @@
|
|||
import SwiftUI
|
||||
import JellyfinAPI
|
||||
|
||||
private struct CutOffShadow: Shape {
|
||||
struct CutOffShadow: Shape {
|
||||
func path(in rect: CGRect) -> Path {
|
||||
var path = Path()
|
||||
|
||||
|
@ -91,22 +91,18 @@ struct LandscapeItemElement: View {
|
|||
)
|
||||
.shadow(radius: focused ? 10.0 : 0, y: focused ? 10.0 : 0)
|
||||
.shadow(radius: focused ? 10.0 : 0, y: focused ? 10.0 : 0)
|
||||
if focused {
|
||||
if inSeasonView ?? false {
|
||||
Text("\(item.getEpisodeLocator() ?? "") • \(item.name ?? "")")
|
||||
.font(.callout)
|
||||
.fontWeight(.semibold)
|
||||
.lineLimit(1)
|
||||
.frame(width: 445)
|
||||
} else {
|
||||
Text(item.type == "Episode" ? "\(item.seriesName ?? "") • \(item.getEpisodeLocator() ?? "")" : item.name ?? "")
|
||||
.font(.callout)
|
||||
.fontWeight(.semibold)
|
||||
.lineLimit(1)
|
||||
.frame(width: 445)
|
||||
}
|
||||
if inSeasonView ?? false {
|
||||
Text("\(item.getEpisodeLocator() ?? "") • \(item.name ?? "")")
|
||||
.font(.callout)
|
||||
.fontWeight(.semibold)
|
||||
.lineLimit(1)
|
||||
.frame(width: 445)
|
||||
} else {
|
||||
Spacer().frame(height: 25)
|
||||
Text(item.type == "Episode" ? "\(item.seriesName ?? "") • \(item.getEpisodeLocator() ?? "")" : item.name ?? "")
|
||||
.font(.callout)
|
||||
.fontWeight(.semibold)
|
||||
.lineLimit(1)
|
||||
.frame(width: 445)
|
||||
}
|
||||
}
|
||||
.onChange(of: envFocused) { envFocus in
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
/*
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
@ -10,7 +10,6 @@
|
|||
import SwiftUI
|
||||
|
||||
struct MediaPlayButtonRowView: View {
|
||||
|
||||
@EnvironmentObject var itemRouter: ItemCoordinator.Router
|
||||
@ObservedObject var viewModel: ItemViewModel
|
||||
@State var wrappedScrollView: UIScrollView?
|
||||
|
@ -23,7 +22,7 @@ struct MediaPlayButtonRowView: View {
|
|||
} label: {
|
||||
MediaViewActionButton(icon: "play.fill", scrollView: $wrappedScrollView)
|
||||
}
|
||||
|
||||
|
||||
Text(viewModel.item.getItemProgressString() != "" ? "\(viewModel.item.getItemProgressString()) left" : L10n.play)
|
||||
.font(.caption)
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ import Foundation
|
|||
import SwiftUI
|
||||
|
||||
struct LibraryListView: View {
|
||||
@EnvironmentObject var mainCoordinator: MainCoordinator.Router
|
||||
@EnvironmentObject var libraryListRouter: LibraryListCoordinator.Router
|
||||
@StateObject var viewModel = LibraryListViewModel()
|
||||
|
||||
var body: some View {
|
||||
|
@ -21,12 +23,15 @@ struct LibraryListView: View {
|
|||
if library.collectionType ?? "" == "movies" || library.collectionType ?? "" == "tvshows" || library.collectionType ?? "" == "music" {
|
||||
EmptyView()
|
||||
} else {
|
||||
NavigationLink(destination: LazyView {
|
||||
LibraryView(viewModel: .init(parentID: library.id), title: library.name ?? "")
|
||||
}) {
|
||||
Button() {
|
||||
if library.collectionType == "livetv" {
|
||||
self.mainCoordinator.root(\.liveTV)
|
||||
} else {
|
||||
self.libraryListRouter.route(to: \.library, (viewModel: LibraryViewModel(), title: library.name ?? ""))
|
||||
}
|
||||
}
|
||||
label: {
|
||||
ZStack {
|
||||
ImageView(src: library.getPrimaryImage(maxWidth: 500), bh: library.getPrimaryImageBlurHash())
|
||||
.opacity(0.4)
|
||||
HStack {
|
||||
Spacer()
|
||||
VStack {
|
||||
|
@ -37,7 +42,7 @@ struct LibraryListView: View {
|
|||
}
|
||||
Spacer()
|
||||
}.padding(32)
|
||||
}.background(Color.black)
|
||||
}
|
||||
.frame(minWidth: 100, maxWidth: .infinity)
|
||||
.frame(height: 100)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,106 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import JellyfinAPI
|
||||
import SwiftUI
|
||||
import SwiftUICollection
|
||||
|
||||
|
||||
struct LiveTVChannelsView: View {
|
||||
@EnvironmentObject var router: LiveTVChannelsCoordinator.Router
|
||||
@StateObject var viewModel = LiveTVChannelsViewModel()
|
||||
|
||||
var body: some View {
|
||||
if viewModel.isLoading == true {
|
||||
ProgressView()
|
||||
} else if !viewModel.rows.isEmpty {
|
||||
CollectionView(rows: viewModel.rows) { section, env in
|
||||
return createGridLayout()
|
||||
} cell: { indexPath, cell in
|
||||
makeCellView(indexPath: indexPath, cell: cell)
|
||||
} supplementaryView: { _, indexPath in
|
||||
EmptyView()
|
||||
.accessibilityIdentifier("\(indexPath.section).\(indexPath.row)")
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.ignoresSafeArea()
|
||||
.onAppear {
|
||||
viewModel.startScheduleCheckTimer()
|
||||
}
|
||||
.onDisappear {
|
||||
viewModel.stopScheduleCheckTimer()
|
||||
}
|
||||
} else {
|
||||
VStack {
|
||||
Text("No results.")
|
||||
Button {
|
||||
viewModel.getChannels()
|
||||
} label: {
|
||||
Text("Reload")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder func makeCellView(indexPath: IndexPath, cell: LiveTVChannelRowCell) -> some View {
|
||||
let item = cell.item
|
||||
let channel = item.channel
|
||||
if channel.type != "Folder" {
|
||||
Button {
|
||||
self.router.route(to: \.videoPlayer, channel)
|
||||
} label: {
|
||||
LiveTVChannelItemElement(
|
||||
channel: channel,
|
||||
program: item.program,
|
||||
startString: item.program?.getLiveStartTimeString(formatter: viewModel.timeFormatter) ?? " ",
|
||||
endString: item.program?.getLiveEndTimeString(formatter: viewModel.timeFormatter) ?? " ",
|
||||
progressPercent: item.program?.getLiveProgressPercentage() ?? 0
|
||||
)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
}
|
||||
}
|
||||
|
||||
private func createGridLayout() -> NSCollectionLayoutSection {
|
||||
// I don't know why tvOS has a margin on the sides of a collection view
|
||||
// But it does, even with contentInset = .zero and ignoreSafeArea.
|
||||
let sideMargin = CGFloat(30)
|
||||
let itemWidth = (UIScreen.main.bounds.width / 4) - (sideMargin * 2)
|
||||
let itemSize = NSCollectionLayoutSize(widthDimension: .absolute(itemWidth),
|
||||
heightDimension: .absolute(itemWidth))
|
||||
let item = NSCollectionLayoutItem(layoutSize: itemSize)
|
||||
item.edgeSpacing = .init(
|
||||
leading: .fixed(8),
|
||||
top: .fixed(8),
|
||||
trailing: .fixed(8),
|
||||
bottom: .fixed(8)
|
||||
)
|
||||
|
||||
|
||||
let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),
|
||||
heightDimension: .absolute(itemWidth))
|
||||
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize,
|
||||
subitems: [item])
|
||||
group.edgeSpacing = .init(
|
||||
leading: .fixed(0),
|
||||
top: .fixed(16),
|
||||
trailing: .fixed(0),
|
||||
bottom: .fixed(16)
|
||||
)
|
||||
group.contentInsets = .zero
|
||||
|
||||
|
||||
let section = NSCollectionLayoutSection(group: group)
|
||||
section.contentInsets = .zero
|
||||
|
||||
return section
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
struct LiveTVHomeView: View {
|
||||
@EnvironmentObject var mainCoordinator: MainCoordinator.Router
|
||||
|
||||
var body: some View {
|
||||
Button {} label: {
|
||||
Text("Return Home")
|
||||
}.onAppear {
|
||||
self.mainCoordinator.root(\.mainTab)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,167 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
struct LiveTVProgramsView: View {
|
||||
@EnvironmentObject var programsRouter: LiveTVProgramsCoordinator.Router
|
||||
@StateObject var viewModel = LiveTVProgramsViewModel()
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
LazyVStack(alignment: .leading) {
|
||||
if !viewModel.recommendedItems.isEmpty,
|
||||
let items = viewModel.recommendedItems {
|
||||
Text("On Now")
|
||||
.font(.headline)
|
||||
.fontWeight(.semibold)
|
||||
.padding(.leading, 90)
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
LazyHStack {
|
||||
Spacer().frame(width: 45)
|
||||
ForEach(items, id: \.id) { item in
|
||||
Button {
|
||||
if let chanId = item.channelId,
|
||||
let chan = viewModel.findChannel(id: chanId) {
|
||||
self.programsRouter.route(to: \.videoPlayer, chan)
|
||||
}
|
||||
} label: {
|
||||
LandscapeItemElement(item: item)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
}
|
||||
Spacer().frame(width: 45)
|
||||
}
|
||||
}.frame(height: 350)
|
||||
}
|
||||
if !viewModel.seriesItems.isEmpty,
|
||||
let items = viewModel.seriesItems {
|
||||
Text("Shows")
|
||||
.font(.headline)
|
||||
.fontWeight(.semibold)
|
||||
.padding(.leading, 90)
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
LazyHStack {
|
||||
Spacer().frame(width: 45)
|
||||
ForEach(items, id: \.id) { item in
|
||||
Button {
|
||||
if let chanId = item.channelId,
|
||||
let chan = viewModel.findChannel(id: chanId) {
|
||||
self.programsRouter.route(to: \.videoPlayer, chan)
|
||||
}
|
||||
} label: {
|
||||
LandscapeItemElement(item: item)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
}
|
||||
Spacer().frame(width: 45)
|
||||
}
|
||||
}.frame(height: 350)
|
||||
}
|
||||
if !viewModel.movieItems.isEmpty,
|
||||
let items = viewModel.movieItems {
|
||||
Text("Movies")
|
||||
.font(.headline)
|
||||
.fontWeight(.semibold)
|
||||
.padding(.leading, 90)
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
LazyHStack {
|
||||
Spacer().frame(width: 45)
|
||||
ForEach(items, id: \.id) { item in
|
||||
Button {
|
||||
if let chanId = item.channelId,
|
||||
let chan = viewModel.findChannel(id: chanId) {
|
||||
self.programsRouter.route(to: \.videoPlayer, chan)
|
||||
}
|
||||
} label: {
|
||||
LandscapeItemElement(item: item)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
}
|
||||
Spacer().frame(width: 45)
|
||||
}
|
||||
}.frame(height: 350)
|
||||
}
|
||||
if !viewModel.sportsItems.isEmpty,
|
||||
let items = viewModel.sportsItems {
|
||||
Text("Sports")
|
||||
.font(.headline)
|
||||
.fontWeight(.semibold)
|
||||
.padding(.leading, 90)
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
LazyHStack {
|
||||
Spacer().frame(width: 45)
|
||||
ForEach(items, id: \.id) { item in
|
||||
Button {
|
||||
if let chanId = item.channelId,
|
||||
let chan = viewModel.findChannel(id: chanId) {
|
||||
self.programsRouter.route(to: \.videoPlayer, chan)
|
||||
}
|
||||
} label: {
|
||||
LandscapeItemElement(item: item)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
}
|
||||
Spacer().frame(width: 45)
|
||||
}
|
||||
}.frame(height: 350)
|
||||
}
|
||||
if !viewModel.kidsItems.isEmpty,
|
||||
let items = viewModel.kidsItems {
|
||||
Text("Kids")
|
||||
.font(.headline)
|
||||
.fontWeight(.semibold)
|
||||
.padding(.leading, 90)
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
LazyHStack {
|
||||
Spacer().frame(width: 45)
|
||||
ForEach(items, id: \.id) { item in
|
||||
Button {
|
||||
if let chanId = item.channelId,
|
||||
let chan = viewModel.findChannel(id: chanId) {
|
||||
self.programsRouter.route(to: \.videoPlayer, chan)
|
||||
}
|
||||
} label: {
|
||||
LandscapeItemElement(item: item)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
}
|
||||
Spacer().frame(width: 45)
|
||||
}
|
||||
}.frame(height: 350)
|
||||
}
|
||||
if !viewModel.newsItems.isEmpty,
|
||||
let items = viewModel.newsItems {
|
||||
Text("News")
|
||||
.font(.headline)
|
||||
.fontWeight(.semibold)
|
||||
.padding(.leading, 90)
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
LazyHStack {
|
||||
Spacer().frame(width: 45)
|
||||
ForEach(items, id: \.id) { item in
|
||||
Button {
|
||||
if let chanId = item.channelId,
|
||||
let chan = viewModel.findChannel(id: chanId) {
|
||||
self.programsRouter.route(to: \.videoPlayer, chan)
|
||||
}
|
||||
} label: {
|
||||
LandscapeItemElement(item: item)
|
||||
}
|
||||
.buttonStyle(PlainNavigationLinkButtonStyle())
|
||||
}
|
||||
Spacer().frame(width: 45)
|
||||
}
|
||||
}.frame(height: 350)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -218,6 +218,9 @@
|
|||
C40CD928271F8DAB000FB198 /* MovieLibrariesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C40CD927271F8DAB000FB198 /* MovieLibrariesView.swift */; };
|
||||
C40CD929271F8DAB000FB198 /* MovieLibrariesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C40CD927271F8DAB000FB198 /* MovieLibrariesView.swift */; };
|
||||
C45B29BB26FAC5B600CEF5E0 /* ColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = E173DA5126D04AAF00CC4EB7 /* ColorExtension.swift */; };
|
||||
C4AE2C3027498D2300AE13CF /* LiveTVHomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4AE2C2F27498D2300AE13CF /* LiveTVHomeView.swift */; };
|
||||
C4AE2C3227498D6A00AE13CF /* LiveTVProgramsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4AE2C3127498D6A00AE13CF /* LiveTVProgramsView.swift */; };
|
||||
C4AE2C3327498DBE00AE13CF /* LiveTVChannelItemElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4E52304272CE68800654268 /* LiveTVChannelItemElement.swift */; };
|
||||
C4BE0763271FC0BB003F4AD1 /* TVLibrariesCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE0762271FC0BB003F4AD1 /* TVLibrariesCoordinator.swift */; };
|
||||
C4BE0764271FC0BB003F4AD1 /* TVLibrariesCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE0762271FC0BB003F4AD1 /* TVLibrariesCoordinator.swift */; };
|
||||
C4BE0766271FC109003F4AD1 /* TVLibrariesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE0765271FC109003F4AD1 /* TVLibrariesViewModel.swift */; };
|
||||
|
@ -226,8 +229,23 @@
|
|||
C4BE076A271FC164003F4AD1 /* TVLibrariesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE0768271FC164003F4AD1 /* TVLibrariesView.swift */; };
|
||||
C4BE076E2720FEA8003F4AD1 /* PortraitItemElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE076D2720FEA8003F4AD1 /* PortraitItemElement.swift */; };
|
||||
C4BE076F2720FEFF003F4AD1 /* PlainNavigationLinkButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 531690F9267AD6EC005D8AB9 /* PlainNavigationLinkButton.swift */; };
|
||||
C4BE07712725EB06003F4AD1 /* LiveTVProgramsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07702725EB06003F4AD1 /* LiveTVProgramsCoordinator.swift */; };
|
||||
C4BE07722725EB06003F4AD1 /* LiveTVProgramsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07702725EB06003F4AD1 /* LiveTVProgramsCoordinator.swift */; };
|
||||
C4BE07742725EB66003F4AD1 /* LiveTVProgramsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07732725EB66003F4AD1 /* LiveTVProgramsView.swift */; };
|
||||
C4BE07762725EBEA003F4AD1 /* LiveTVProgramsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07752725EBEA003F4AD1 /* LiveTVProgramsViewModel.swift */; };
|
||||
C4BE07772725EBEA003F4AD1 /* LiveTVProgramsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07752725EBEA003F4AD1 /* LiveTVProgramsViewModel.swift */; };
|
||||
C4BE07792726EE82003F4AD1 /* LiveTVTabCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07782726EE82003F4AD1 /* LiveTVTabCoordinator.swift */; };
|
||||
C4BE077A2726EE82003F4AD1 /* LiveTVTabCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07782726EE82003F4AD1 /* LiveTVTabCoordinator.swift */; };
|
||||
C4BE07852728446F003F4AD1 /* LiveTVChannelsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07842728446F003F4AD1 /* LiveTVChannelsViewModel.swift */; };
|
||||
C4BE07862728446F003F4AD1 /* LiveTVChannelsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07842728446F003F4AD1 /* LiveTVChannelsViewModel.swift */; };
|
||||
C4BE07882728448B003F4AD1 /* LiveTVChannelsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07872728448B003F4AD1 /* LiveTVChannelsCoordinator.swift */; };
|
||||
C4BE07892728448B003F4AD1 /* LiveTVChannelsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE07872728448B003F4AD1 /* LiveTVChannelsCoordinator.swift */; };
|
||||
C4BE078B272844AF003F4AD1 /* LiveTVChannelsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE078A272844AF003F4AD1 /* LiveTVChannelsView.swift */; };
|
||||
C4BE078C272844AF003F4AD1 /* LiveTVChannelsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE078A272844AF003F4AD1 /* LiveTVChannelsView.swift */; };
|
||||
C4BE078E27298818003F4AD1 /* LiveTVHomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4BE078D27298817003F4AD1 /* LiveTVHomeView.swift */; };
|
||||
C4E5081B2703F82A0045C9AB /* LibraryListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4E508172703E8190045C9AB /* LibraryListView.swift */; };
|
||||
C4E5081D2703F8370045C9AB /* LibrarySearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4E5081C2703F8370045C9AB /* LibrarySearchView.swift */; };
|
||||
C4E52305272CE68800654268 /* LiveTVChannelItemElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4E52304272CE68800654268 /* LiveTVChannelItemElement.swift */; };
|
||||
E100720726BDABC100CE3E31 /* MediaPlayButtonRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E100720626BDABC100CE3E31 /* MediaPlayButtonRowView.swift */; };
|
||||
E10D87DA2784E4F100BD264C /* ItemViewDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E10D87D92784E4F100BD264C /* ItemViewDetailsView.swift */; };
|
||||
E10D87DC2784EC5200BD264C /* EpisodesRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E10D87DB2784EC5200BD264C /* EpisodesRowView.swift */; };
|
||||
|
@ -585,12 +603,25 @@
|
|||
C40CD921271F8CD8000FB198 /* MoviesLibrariesCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoviesLibrariesCoordinator.swift; sourceTree = "<group>"; };
|
||||
C40CD924271F8D1E000FB198 /* MovieLibrariesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieLibrariesViewModel.swift; sourceTree = "<group>"; };
|
||||
C40CD927271F8DAB000FB198 /* MovieLibrariesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieLibrariesView.swift; sourceTree = "<group>"; };
|
||||
C4AE2C2F27498D2300AE13CF /* LiveTVHomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVHomeView.swift; sourceTree = "<group>"; };
|
||||
C4AE2C3127498D6A00AE13CF /* LiveTVProgramsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVProgramsView.swift; sourceTree = "<group>"; };
|
||||
C4BE0762271FC0BB003F4AD1 /* TVLibrariesCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TVLibrariesCoordinator.swift; sourceTree = "<group>"; };
|
||||
C4BE0765271FC109003F4AD1 /* TVLibrariesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TVLibrariesViewModel.swift; sourceTree = "<group>"; };
|
||||
C4BE0768271FC164003F4AD1 /* TVLibrariesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TVLibrariesView.swift; sourceTree = "<group>"; };
|
||||
C4BE076D2720FEA8003F4AD1 /* PortraitItemElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PortraitItemElement.swift; sourceTree = "<group>"; };
|
||||
C4BE07702725EB06003F4AD1 /* LiveTVProgramsCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVProgramsCoordinator.swift; sourceTree = "<group>"; };
|
||||
C4BE07732725EB66003F4AD1 /* LiveTVProgramsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVProgramsView.swift; sourceTree = "<group>"; };
|
||||
C4BE07752725EBEA003F4AD1 /* LiveTVProgramsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVProgramsViewModel.swift; sourceTree = "<group>"; };
|
||||
C4BE07782726EE82003F4AD1 /* LiveTVTabCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVTabCoordinator.swift; sourceTree = "<group>"; };
|
||||
C4BE07842728446F003F4AD1 /* LiveTVChannelsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVChannelsViewModel.swift; sourceTree = "<group>"; };
|
||||
C4BE07872728448B003F4AD1 /* LiveTVChannelsCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVChannelsCoordinator.swift; sourceTree = "<group>"; };
|
||||
C4BE078A272844AF003F4AD1 /* LiveTVChannelsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVChannelsView.swift; sourceTree = "<group>"; };
|
||||
C4BE078D27298817003F4AD1 /* LiveTVHomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVHomeView.swift; sourceTree = "<group>"; };
|
||||
C4E508172703E8190045C9AB /* LibraryListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryListView.swift; sourceTree = "<group>"; };
|
||||
C4E5081C2703F8370045C9AB /* LibrarySearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibrarySearchView.swift; sourceTree = "<group>"; };
|
||||
C4E52304272CE68800654268 /* LiveTVChannelItemElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveTVChannelItemElement.swift; sourceTree = "<group>"; };
|
||||
D79953919FED0C4DF72BA578 /* Pods-JellyfinPlayer tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JellyfinPlayer tvOS.release.xcconfig"; path = "Target Support Files/Pods-JellyfinPlayer tvOS/Pods-JellyfinPlayer tvOS.release.xcconfig"; sourceTree = "<group>"; };
|
||||
DE5004F745B19E28744A7DE7 /* Pods-JellyfinPlayer tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JellyfinPlayer tvOS.debug.xcconfig"; path = "Target Support Files/Pods-JellyfinPlayer tvOS/Pods-JellyfinPlayer tvOS.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
E100720626BDABC100CE3E31 /* MediaPlayButtonRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaPlayButtonRowView.swift; sourceTree = "<group>"; };
|
||||
E10D87D92784E4F100BD264C /* ItemViewDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemViewDetailsView.swift; sourceTree = "<group>"; };
|
||||
E10D87DB2784EC5200BD264C /* EpisodesRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpisodesRowView.swift; sourceTree = "<group>"; };
|
||||
|
@ -784,7 +815,11 @@
|
|||
625CB5742678C33500530A6E /* LibraryListViewModel.swift */,
|
||||
62E632DB267D2E130063E547 /* LibrarySearchViewModel.swift */,
|
||||
62E632DF267D30CA0063E547 /* LibraryViewModel.swift */,
|
||||
C4BE07752725EBEA003F4AD1 /* LiveTVProgramsViewModel.swift */,
|
||||
536D3D75267BA9BB0004248C /* MainTabViewModel.swift */,
|
||||
C4BE07842728446F003F4AD1 /* LiveTVChannelsViewModel.swift */,
|
||||
C40CD924271F8D1E000FB198 /* MovieLibrariesViewModel.swift */,
|
||||
C4BE0765271FC109003F4AD1 /* TVLibrariesViewModel.swift */,
|
||||
62E632E2267D3BA60063E547 /* MovieItemViewModel.swift */,
|
||||
C40CD924271F8D1E000FB198 /* MovieLibrariesViewModel.swift */,
|
||||
62E632E8267D3FF50063E547 /* SeasonItemViewModel.swift */,
|
||||
|
@ -1188,6 +1223,9 @@
|
|||
62C29EA526D1036A00C1D2E7 /* HomeCoordinator.swift */,
|
||||
6220D0BF26D61C5000B8E046 /* ItemCoordinator.swift */,
|
||||
6220D0B326D5ED8000B8E046 /* LibraryCoordinator.swift */,
|
||||
C4BE07702725EB06003F4AD1 /* LiveTVProgramsCoordinator.swift */,
|
||||
C4BE07782726EE82003F4AD1 /* LiveTVTabCoordinator.swift */,
|
||||
C4BE07872728448B003F4AD1 /* LiveTVChannelsCoordinator.swift */,
|
||||
62C29EA726D103D500C1D2E7 /* LibraryListCoordinator.swift */,
|
||||
E193D5412719404B00900D82 /* MainCoordinator */,
|
||||
C40CD921271F8CD8000FB198 /* MoviesLibrariesCoordinator.swift */,
|
||||
|
@ -1265,6 +1303,9 @@
|
|||
C4E508172703E8190045C9AB /* LibraryListView.swift */,
|
||||
C4E5081C2703F8370045C9AB /* LibrarySearchView.swift */,
|
||||
53A83C32268A309300DF3D92 /* LibraryView.swift */,
|
||||
C4BE07732725EB66003F4AD1 /* LiveTVProgramsView.swift */,
|
||||
C4BE078A272844AF003F4AD1 /* LiveTVChannelsView.swift */,
|
||||
C4BE078D27298817003F4AD1 /* LiveTVHomeView.swift */,
|
||||
C40CD927271F8DAB000FB198 /* MovieLibrariesView.swift */,
|
||||
C4BE0768271FC164003F4AD1 /* TVLibrariesView.swift */,
|
||||
531690EE267ABF72005D8AB9 /* NextUpView.swift */,
|
||||
|
@ -1306,6 +1347,8 @@
|
|||
625CB56E2678C23300530A6E /* HomeView.swift */,
|
||||
E14F7D0A26DB3714007C3AE6 /* ItemView */,
|
||||
53FF7F29263CF3F500585C35 /* LatestMediaView.swift */,
|
||||
C4AE2C2F27498D2300AE13CF /* LiveTVHomeView.swift */,
|
||||
C4AE2C3127498D6A00AE13CF /* LiveTVProgramsView.swift */,
|
||||
53E4E646263F6CF100F67C6B /* LibraryFilterView.swift */,
|
||||
6213388F265F83A900A81A2A /* LibraryListView.swift */,
|
||||
53EE24E5265060780068F029 /* LibrarySearchView.swift */,
|
||||
|
@ -1426,6 +1469,7 @@
|
|||
E1AD105326D96F5A003E4A08 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C4E52304272CE68800654268 /* LiveTVChannelItemElement.swift */,
|
||||
531690F9267AD6EC005D8AB9 /* PlainNavigationLinkButton.swift */,
|
||||
531AC8BE26750DE20091C7EB /* ImageView.swift */,
|
||||
621338B22660A07800A81A2A /* LazyView.swift */,
|
||||
|
@ -1909,6 +1953,8 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E193D53627193F8500900D82 /* LibraryCoordinator.swift in Sources */,
|
||||
C4BE07742725EB66003F4AD1 /* LiveTVProgramsView.swift in Sources */,
|
||||
531069572684E7EE00CFFDBA /* InfoTabBarViewController.swift in Sources */,
|
||||
E18845F626DD631E00B0C5B7 /* BaseItemDto+Stackable.swift in Sources */,
|
||||
E1E5D53E2783B05200692DFE /* CinematicMovieItemView.swift in Sources */,
|
||||
E193D4DC27193CCA00900D82 /* PillStackable.swift in Sources */,
|
||||
|
@ -1931,6 +1977,8 @@
|
|||
E1FCD09726C47118007C8DCF /* ErrorMessage.swift in Sources */,
|
||||
E193D53527193F8100900D82 /* ItemCoordinator.swift in Sources */,
|
||||
53116A19268B947A003024C9 /* PlainLinkButton.swift in Sources */,
|
||||
E193D53E27193F9A00900D82 /* VideoPlayerCoordinator.swift in Sources */,
|
||||
C4BE07772725EBEA003F4AD1 /* LiveTVProgramsViewModel.swift in Sources */,
|
||||
536D3D88267C17350004248C /* PublicUserButton.swift in Sources */,
|
||||
62E632EA267D3FF50063E547 /* SeasonItemViewModel.swift in Sources */,
|
||||
E1C812CC277AE40A00918266 /* VideoPlayerView.swift in Sources */,
|
||||
|
@ -1949,6 +1997,7 @@
|
|||
62EC3530267666A5000E9F2D /* SessionManager.swift in Sources */,
|
||||
62671DB327159C1800199D95 /* ItemCoordinator.swift in Sources */,
|
||||
E1E5D5372783A52C00692DFE /* CinematicEpisodeItemView.swift in Sources */,
|
||||
C4BE078E27298818003F4AD1 /* LiveTVHomeView.swift in Sources */,
|
||||
E1AD104B26D94822003E4A08 /* DetailItem.swift in Sources */,
|
||||
E13DD3E227176BD3009D4DAF /* ServerListViewModel.swift in Sources */,
|
||||
53272539268C20100035FBF1 /* EpisodeItemView.swift in Sources */,
|
||||
|
@ -1971,9 +2020,11 @@
|
|||
E100720726BDABC100CE3E31 /* MediaPlayButtonRowView.swift in Sources */,
|
||||
E17885A02780F55C0094FBCF /* tvOSVLCOverlay.swift in Sources */,
|
||||
E193D54D2719426600900D82 /* LibraryFilterView.swift in Sources */,
|
||||
C4BE07892728448B003F4AD1 /* LiveTVChannelsCoordinator.swift in Sources */,
|
||||
E193D53927193F8E00900D82 /* SearchCoordinator.swift in Sources */,
|
||||
E193D4D927193CAC00900D82 /* PortraitImageStackable.swift in Sources */,
|
||||
535870A52669D8AE00D05A09 /* ParallaxHeader.swift in Sources */,
|
||||
C4BE078C272844AF003F4AD1 /* LiveTVChannelsView.swift in Sources */,
|
||||
E1D4BF852719D25A00A11E64 /* TrackLanguage.swift in Sources */,
|
||||
53272532268BF09D0035FBF1 /* MediaViewActionButton.swift in Sources */,
|
||||
531690F0267ABF72005D8AB9 /* NextUpView.swift in Sources */,
|
||||
|
@ -1981,8 +2032,10 @@
|
|||
E193D5502719430400900D82 /* ServerDetailView.swift in Sources */,
|
||||
E11B1B6D2718CD68006DA3E8 /* JellyfinAPIError.swift in Sources */,
|
||||
E1C812D1277AE4E300918266 /* tvOSVideoPlayerCoordinator.swift in Sources */,
|
||||
C4E52305272CE68800654268 /* LiveTVChannelItemElement.swift in Sources */,
|
||||
E193D53D27193F9700900D82 /* UserSignInCoordinator.swift in Sources */,
|
||||
535870A72669D8AE00D05A09 /* MultiSelectorView.swift in Sources */,
|
||||
C4BE07862728446F003F4AD1 /* LiveTVChannelsViewModel.swift in Sources */,
|
||||
E1AD104E26D96CE3003E4A08 /* BaseItemDtoExtensions.swift in Sources */,
|
||||
62E632DD267D2E130063E547 /* LibrarySearchViewModel.swift in Sources */,
|
||||
536D3D81267BDFC60004248C /* PortraitItemElement.swift in Sources */,
|
||||
|
@ -2023,6 +2076,7 @@
|
|||
5321753E2671DE9C005491E6 /* Typings.swift in Sources */,
|
||||
E1C812CA277AE40900918266 /* PlayerOverlayDelegate.swift in Sources */,
|
||||
E1AA33202782639D00F6439C /* OverlayType.swift in Sources */,
|
||||
C4BE07722725EB06003F4AD1 /* LiveTVProgramsCoordinator.swift in Sources */,
|
||||
E1F0204F26CCCA74001C1C3B /* VideoPlayerJumpLength.swift in Sources */,
|
||||
53ABFDEB2679753200886593 /* ConnectToServerView.swift in Sources */,
|
||||
6264E88D273850380081A12A /* Strings.swift in Sources */,
|
||||
|
@ -2047,6 +2101,7 @@
|
|||
E131691826C583BC0074BFEE /* LogConstructor.swift in Sources */,
|
||||
E1E5D5512783E67700692DFE /* ExperimentalSettingsView.swift in Sources */,
|
||||
C4BE076A271FC164003F4AD1 /* TVLibrariesView.swift in Sources */,
|
||||
C4BE077A2726EE82003F4AD1 /* LiveTVTabCoordinator.swift in Sources */,
|
||||
E13DD3C327164941009D4DAF /* SwiftfinStore.swift in Sources */,
|
||||
09389CC826819B4600AE350E /* VideoPlayerModel.swift in Sources */,
|
||||
E193D553271943D500900D82 /* tvOSMainTabCoordinator.swift in Sources */,
|
||||
|
@ -2086,7 +2141,9 @@
|
|||
6220D0AD26D5EABB00B8E046 /* ViewExtensions.swift in Sources */,
|
||||
E13DD3EC27178A54009D4DAF /* UserSignInViewModel.swift in Sources */,
|
||||
625CB5772678C34300530A6E /* ConnectToServerViewModel.swift in Sources */,
|
||||
C4BE07852728446F003F4AD1 /* LiveTVChannelsViewModel.swift in Sources */,
|
||||
536D3D78267BD5C30004248C /* ViewModel.swift in Sources */,
|
||||
C4BE078B272844AF003F4AD1 /* LiveTVChannelsView.swift in Sources */,
|
||||
E1FCD08826C35A0D007C8DCF /* NetworkError.swift in Sources */,
|
||||
E13DD3E527177D15009D4DAF /* ServerListView.swift in Sources */,
|
||||
E18845F826DEA9C900B0C5B7 /* ItemViewBody.swift in Sources */,
|
||||
|
@ -2094,6 +2151,7 @@
|
|||
E188460426DEF04800B0C5B7 /* EpisodeCardVStackView.swift in Sources */,
|
||||
E19169CE272514760085832A /* HTTPScheme.swift in Sources */,
|
||||
53192D5D265AA78A008A4215 /* DeviceProfileBuilder.swift in Sources */,
|
||||
C4AE2C3027498D2300AE13CF /* LiveTVHomeView.swift in Sources */,
|
||||
62133890265F83A900A81A2A /* LibraryListView.swift in Sources */,
|
||||
62C29EA326D1030F00C1D2E7 /* ConnectToServerCoodinator.swift in Sources */,
|
||||
62E632DA267D2BC40063E547 /* LatestMediaViewModel.swift in Sources */,
|
||||
|
@ -2106,6 +2164,7 @@
|
|||
E11D224227378428003F9CB3 /* ServerDetailCoordinator.swift in Sources */,
|
||||
6264E88C273850380081A12A /* Strings.swift in Sources */,
|
||||
C4BE0766271FC109003F4AD1 /* TVLibrariesViewModel.swift in Sources */,
|
||||
C4AE2C3227498D6A00AE13CF /* LiveTVProgramsView.swift in Sources */,
|
||||
62ECA01826FA685A00E8EBB7 /* DeepLink.swift in Sources */,
|
||||
62E632E6267D3F5B0063E547 /* EpisodeItemViewModel.swift in Sources */,
|
||||
E131691726C583BC0074BFEE /* LogConstructor.swift in Sources */,
|
||||
|
@ -2130,15 +2189,18 @@
|
|||
6220D0CC26D640C400B8E046 /* AppURLHandler.swift in Sources */,
|
||||
62E632F3267D54030063E547 /* ItemViewModel.swift in Sources */,
|
||||
53DE4BD2267098F300739748 /* SearchBarView.swift in Sources */,
|
||||
C4AE2C3327498DBE00AE13CF /* LiveTVChannelItemElement.swift in Sources */,
|
||||
E1E48CC9271E6D410021A2F9 /* RefreshHelper.swift in Sources */,
|
||||
E1AA33222782648000F6439C /* OverlaySliderColor.swift in Sources */,
|
||||
E1D4BF842719D25A00A11E64 /* TrackLanguage.swift in Sources */,
|
||||
C4BE07792726EE82003F4AD1 /* LiveTVTabCoordinator.swift in Sources */,
|
||||
E14F7D0726DB36EF007C3AE6 /* ItemPortraitMainView.swift in Sources */,
|
||||
E1AD106226D9B7CD003E4A08 /* ItemPortraitHeaderOverlayView.swift in Sources */,
|
||||
53E4E649263F725B00F67C6B /* MultiSelectorView.swift in Sources */,
|
||||
6220D0C626D62D8700B8E046 /* iOSVideoPlayerCoordinator.swift in Sources */,
|
||||
E11B1B6C2718CD68006DA3E8 /* JellyfinAPIError.swift in Sources */,
|
||||
E1D4BF812719D22800A11E64 /* AppAppearance.swift in Sources */,
|
||||
C4BE07712725EB06003F4AD1 /* LiveTVProgramsCoordinator.swift in Sources */,
|
||||
621338B32660A07800A81A2A /* LazyView.swift in Sources */,
|
||||
6220D0B126D5EC9900B8E046 /* SettingsCoordinator.swift in Sources */,
|
||||
E10D87DC2784EC5200BD264C /* EpisodesRowView.swift in Sources */,
|
||||
|
@ -2146,6 +2208,7 @@
|
|||
E1AA331D2782541500F6439C /* PrimaryButtonView.swift in Sources */,
|
||||
62C29EA626D1036A00C1D2E7 /* HomeCoordinator.swift in Sources */,
|
||||
531AC8BF26750DE20091C7EB /* ImageView.swift in Sources */,
|
||||
C4BE07762725EBEA003F4AD1 /* LiveTVProgramsViewModel.swift in Sources */,
|
||||
E13DD3E927177ED6009D4DAF /* ServerListCoordinator.swift in Sources */,
|
||||
E1C812BD277A8E5D00918266 /* PlayerOverlayDelegate.swift in Sources */,
|
||||
E13DD3C227164941009D4DAF /* SwiftfinStore.swift in Sources */,
|
||||
|
@ -2169,6 +2232,7 @@
|
|||
E1AD104D26D96CE3003E4A08 /* BaseItemDtoExtensions.swift in Sources */,
|
||||
E13DD3BF27163DD7009D4DAF /* AppDelegate.swift in Sources */,
|
||||
535870AD2669D8DD00D05A09 /* Typings.swift in Sources */,
|
||||
C4BE07882728448B003F4AD1 /* LiveTVChannelsCoordinator.swift in Sources */,
|
||||
E1AD105F26D9ADDD003E4A08 /* NameGUIDPairExtensions.swift in Sources */,
|
||||
E13DD3D5271693CD009D4DAF /* SwiftfinStoreDefaults.swift in Sources */,
|
||||
62E1DCC3273CE19800C9AE76 /* URLExtensions.swift in Sources */,
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1300"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5358705F2669D21600D05A09"
|
||||
BuildableName = "JellyfinPlayer tvOS.app"
|
||||
BlueprintName = "JellyfinPlayer tvOS"
|
||||
ReferencedContainer = "container:JellyfinPlayer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5358705F2669D21600D05A09"
|
||||
BuildableName = "JellyfinPlayer tvOS.app"
|
||||
BlueprintName = "JellyfinPlayer tvOS"
|
||||
ReferencedContainer = "container:JellyfinPlayer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5358705F2669D21600D05A09"
|
||||
BuildableName = "JellyfinPlayer tvOS.app"
|
||||
BlueprintName = "JellyfinPlayer tvOS"
|
||||
ReferencedContainer = "container:JellyfinPlayer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
|
@ -87,8 +87,8 @@
|
|||
"repositoryURL": "https://github.com/rundfunk47/stinsen",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "3d06c7603c70f8af1bd49f8d49f17e98f25b2d6a",
|
||||
"version": "2.0.2"
|
||||
"revision": "5e6c714f6f308877c8a988523915f9eb592d7d82",
|
||||
"version": "2.0.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
/* JellyfinPlayer/Swiftfin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Stinsen
|
||||
import SwiftUI
|
||||
|
||||
struct LiveTVHomeView: View {
|
||||
var body: some View {
|
||||
Text("Coming Soon")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
/* JellyfinPlayer/Swiftfin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Stinsen
|
||||
import SwiftUI
|
||||
|
||||
struct LiveTVProgramsView: View {
|
||||
var body: some View {
|
||||
Text("Coming Soon")
|
||||
}
|
||||
}
|
|
@ -18,7 +18,13 @@ final class LibraryListCoordinator: NavigationCoordinatable {
|
|||
@Root var start = makeStart
|
||||
@Route(.push) var search = makeSearch
|
||||
@Route(.push) var library = makeLibrary
|
||||
|
||||
let viewModel: LibraryListViewModel
|
||||
|
||||
init(viewModel: LibraryListViewModel) {
|
||||
self.viewModel = viewModel
|
||||
}
|
||||
|
||||
func makeLibrary(params: LibraryCoordinatorParams) -> LibraryCoordinator {
|
||||
LibraryCoordinator(viewModel: params.viewModel, title: params.title)
|
||||
}
|
||||
|
@ -29,6 +35,6 @@ final class LibraryListCoordinator: NavigationCoordinatable {
|
|||
|
||||
@ViewBuilder
|
||||
func makeStart() -> some View {
|
||||
LibraryListView()
|
||||
LibraryListView(viewModel: self.viewModel)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import JellyfinAPI
|
||||
import Stinsen
|
||||
import SwiftUI
|
||||
|
||||
final class LiveTVChannelsCoordinator: NavigationCoordinatable {
|
||||
let stack = NavigationStack(initial: \LiveTVChannelsCoordinator.start)
|
||||
|
||||
@Root var start = makeStart
|
||||
@Route(.modal) var modalItem = makeModalItem
|
||||
@Route(.fullScreen) var videoPlayer = makeVideoPlayer
|
||||
|
||||
func makeModalItem(item: BaseItemDto) -> NavigationViewCoordinator<ItemCoordinator> {
|
||||
return NavigationViewCoordinator(ItemCoordinator(item: item))
|
||||
}
|
||||
|
||||
func makeVideoPlayer(item: BaseItemDto) -> NavigationViewCoordinator<VideoPlayerCoordinator> {
|
||||
NavigationViewCoordinator(VideoPlayerCoordinator(item: item))
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
func makeStart() -> some View {
|
||||
LiveTVChannelsView()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import JellyfinAPI
|
||||
import Stinsen
|
||||
import SwiftUI
|
||||
|
||||
final class LiveTVProgramsCoordinator: NavigationCoordinatable {
|
||||
|
||||
let stack = NavigationStack(initial: \LiveTVProgramsCoordinator.start)
|
||||
|
||||
@Root var start = makeStart
|
||||
@Route(.fullScreen) var videoPlayer = makeVideoPlayer
|
||||
|
||||
func makeVideoPlayer(item: BaseItemDto) -> NavigationViewCoordinator<VideoPlayerCoordinator> {
|
||||
NavigationViewCoordinator(VideoPlayerCoordinator(item: item))
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
func makeStart() -> some View {
|
||||
LiveTVProgramsView()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import Stinsen
|
||||
|
||||
final class LiveTVTabCoordinator: TabCoordinatable {
|
||||
var child = TabChild(startingItems: [
|
||||
\LiveTVTabCoordinator.programs,
|
||||
\LiveTVTabCoordinator.channels,
|
||||
\LiveTVTabCoordinator.home
|
||||
])
|
||||
|
||||
@Route(tabItem: makeProgramsTab) var programs = makePrograms
|
||||
@Route(tabItem: makeChannelsTab) var channels = makeChannels
|
||||
@Route(tabItem: makeHomeTab) var home = makeHome
|
||||
|
||||
func makePrograms() -> NavigationViewCoordinator<LiveTVProgramsCoordinator> {
|
||||
return NavigationViewCoordinator(LiveTVProgramsCoordinator())
|
||||
}
|
||||
|
||||
@ViewBuilder func makeProgramsTab(isActive: Bool) -> some View {
|
||||
HStack {
|
||||
Image(systemName: "tv")
|
||||
Text("Programs")
|
||||
}
|
||||
}
|
||||
|
||||
func makeChannels() -> NavigationViewCoordinator<LiveTVChannelsCoordinator> {
|
||||
return NavigationViewCoordinator(LiveTVChannelsCoordinator())
|
||||
}
|
||||
|
||||
@ViewBuilder func makeChannelsTab(isActive: Bool) -> some View {
|
||||
HStack {
|
||||
Image(systemName: "square.grid.3x3")
|
||||
Text("Channels")
|
||||
}
|
||||
}
|
||||
|
||||
func makeHome() -> LiveTVHomeView {
|
||||
return LiveTVHomeView()
|
||||
}
|
||||
|
||||
@ViewBuilder func makeHomeTab(isActive: Bool) -> some View {
|
||||
HStack {
|
||||
Image(systemName: "house")
|
||||
Text("Home")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ final class MainTabCoordinator: TabCoordinatable {
|
|||
}
|
||||
|
||||
func makeAllMedia() -> NavigationViewCoordinator<LibraryListCoordinator> {
|
||||
return NavigationViewCoordinator(LibraryListCoordinator())
|
||||
return NavigationViewCoordinator(LibraryListCoordinator(viewModel: LibraryListViewModel()))
|
||||
}
|
||||
|
||||
@ViewBuilder func makeAllMediaTab(isActive: Bool) -> some View {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
/*
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
@ -17,7 +17,8 @@ final class MainCoordinator: NavigationCoordinatable {
|
|||
|
||||
@Root var mainTab = makeMainTab
|
||||
@Root var serverList = makeServerList
|
||||
|
||||
@Root var liveTV = makeLiveTV
|
||||
|
||||
@ViewBuilder
|
||||
func customize(_ view: AnyView) -> some View {
|
||||
view.background {
|
||||
|
@ -59,4 +60,8 @@ final class MainCoordinator: NavigationCoordinatable {
|
|||
func makeServerList() -> NavigationViewCoordinator<ServerListCoordinator> {
|
||||
NavigationViewCoordinator(ServerListCoordinator())
|
||||
}
|
||||
|
||||
func makeLiveTV() -> LiveTVTabCoordinator {
|
||||
LiveTVTabCoordinator()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ final class MainTabCoordinator: TabCoordinatable {
|
|||
}
|
||||
|
||||
func makeOther() -> NavigationViewCoordinator<LibraryListCoordinator> {
|
||||
return NavigationViewCoordinator(LibraryListCoordinator())
|
||||
return NavigationViewCoordinator(LibraryListCoordinator(viewModel: LibraryListViewModel()))
|
||||
}
|
||||
|
||||
@ViewBuilder func makeOtherTab(isActive: Bool) -> some View {
|
||||
|
|
|
@ -170,7 +170,34 @@ public extension BaseItemDto {
|
|||
return "\(String(progminutes))m"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func getLiveStartTimeString(formatter: DateFormatter) -> String {
|
||||
if let startDate = self.startDate {
|
||||
return formatter.string(from: startDate)
|
||||
}
|
||||
return " "
|
||||
}
|
||||
|
||||
func getLiveEndTimeString(formatter: DateFormatter) -> String {
|
||||
if let endDate = self.endDate {
|
||||
return formatter.string(from: endDate)
|
||||
}
|
||||
return " "
|
||||
}
|
||||
|
||||
func getLiveProgressPercentage() -> Double {
|
||||
if let startDate = self.startDate,
|
||||
let endDate = self.endDate {
|
||||
let start = startDate.timeIntervalSinceReferenceDate
|
||||
let end = endDate.timeIntervalSinceReferenceDate
|
||||
let now = Date().timeIntervalSinceReferenceDate
|
||||
let length = end - start
|
||||
let progress = now - start
|
||||
return progress / length
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// MARK: ItemType
|
||||
|
||||
enum ItemType: String {
|
||||
|
|
|
@ -11,6 +11,7 @@ import Combine
|
|||
import CombineExt
|
||||
import Foundation
|
||||
import JellyfinAPI
|
||||
import SwiftUI
|
||||
|
||||
final class LibrarySearchViewModel: ViewModel {
|
||||
|
||||
|
@ -42,8 +43,7 @@ final class LibrarySearchViewModel: ViewModel {
|
|||
}
|
||||
|
||||
func setupPublishersForSupportedItemType() {
|
||||
|
||||
let supportedItemTypeListPublishers = Publishers.CombineLatest3($movieItems, $showItems, $episodeItems)
|
||||
Publishers.CombineLatest3($movieItems, $showItems, $episodeItems)
|
||||
.debounce(for: 0.25, scheduler: DispatchQueue.main)
|
||||
.map { arg -> [ItemType] in
|
||||
var typeList = [ItemType]()
|
||||
|
@ -58,21 +58,29 @@ final class LibrarySearchViewModel: ViewModel {
|
|||
}
|
||||
return typeList
|
||||
}
|
||||
|
||||
supportedItemTypeListPublishers
|
||||
.assign(to: \.supportedItemTypeList, on: self)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(receiveValue: { [weak self] typeList in
|
||||
withAnimation {
|
||||
self?.supportedItemTypeList = typeList
|
||||
}
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
|
||||
supportedItemTypeListPublishers
|
||||
.withLatestFrom(supportedItemTypeListPublishers, $selectedItemType)
|
||||
.compactMap { typeList, selectedItemType in
|
||||
if typeList.contains(selectedItemType) {
|
||||
$supportedItemTypeList
|
||||
.receive(on: DispatchQueue.main)
|
||||
.withLatestFrom($selectedItemType)
|
||||
.compactMap { selectedItemType in
|
||||
if self.supportedItemTypeList.contains(selectedItemType) {
|
||||
return selectedItemType
|
||||
} else {
|
||||
return typeList.first
|
||||
return self.supportedItemTypeList.first
|
||||
}
|
||||
}
|
||||
.assign(to: \.selectedItemType, on: self)
|
||||
.sink(receiveValue: { [weak self] itemType in
|
||||
withAnimation {
|
||||
self?.selectedItemType = itemType
|
||||
}
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
|
@ -87,6 +95,7 @@ final class LibrarySearchViewModel: ViewModel {
|
|||
enableTotalRecordCount: false,
|
||||
enableImages: false)
|
||||
.trackActivity(loading)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
|
@ -99,8 +108,10 @@ final class LibrarySearchViewModel: ViewModel {
|
|||
ItemsAPI.getItemsByUserId(userId: SessionManager.main.currentLogin.user.id, limit: 50, recursive: true, searchTerm: query,
|
||||
sortOrder: [.ascending], parentId: parentID,
|
||||
fields: [.primaryImageAspectRatio, .seriesPrimaryImage, .seasonUserData, .overview, .genres, .people],
|
||||
includeItemTypes: [ItemType.movie.rawValue], sortBy: ["SortName"], enableUserData: true, enableImages: true)
|
||||
includeItemTypes: [ItemType.movie.rawValue], sortBy: ["SortName"], enableUserData: true,
|
||||
enableImages: true)
|
||||
.trackActivity(loading)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
|
@ -110,8 +121,10 @@ final class LibrarySearchViewModel: ViewModel {
|
|||
ItemsAPI.getItemsByUserId(userId: SessionManager.main.currentLogin.user.id, limit: 50, recursive: true, searchTerm: query,
|
||||
sortOrder: [.ascending], parentId: parentID,
|
||||
fields: [.primaryImageAspectRatio, .seriesPrimaryImage, .seasonUserData, .overview, .genres, .people],
|
||||
includeItemTypes: [ItemType.series.rawValue], sortBy: ["SortName"], enableUserData: true, enableImages: true)
|
||||
includeItemTypes: [ItemType.series.rawValue], sortBy: ["SortName"], enableUserData: true,
|
||||
enableImages: true)
|
||||
.trackActivity(loading)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
|
@ -121,8 +134,10 @@ final class LibrarySearchViewModel: ViewModel {
|
|||
ItemsAPI.getItemsByUserId(userId: SessionManager.main.currentLogin.user.id, limit: 50, recursive: true, searchTerm: query,
|
||||
sortOrder: [.ascending], parentId: parentID,
|
||||
fields: [.primaryImageAspectRatio, .seriesPrimaryImage, .seasonUserData, .overview, .genres, .people],
|
||||
includeItemTypes: [ItemType.episode.rawValue], sortBy: ["SortName"], enableUserData: true, enableImages: true)
|
||||
includeItemTypes: [ItemType.episode.rawValue], sortBy: ["SortName"], enableUserData: true,
|
||||
enableImages: true)
|
||||
.trackActivity(loading)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
|
|
|
@ -48,14 +48,13 @@ final class LibraryViewModel: ViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
init(
|
||||
parentID: String? = nil,
|
||||
person: BaseItemPerson? = nil,
|
||||
genre: NameGuidPair? = nil,
|
||||
studio: NameGuidPair? = nil,
|
||||
filters: LibraryFilters = LibraryFilters(filters: [], sortOrder: [.ascending], withGenres: [], sortBy: [.name]),
|
||||
columns: Int = 7
|
||||
) {
|
||||
init(parentID: String? = nil,
|
||||
person: BaseItemPerson? = nil,
|
||||
genre: NameGuidPair? = nil,
|
||||
studio: NameGuidPair? = nil,
|
||||
filters: LibraryFilters = LibraryFilters(filters: [], sortOrder: [.ascending], withGenres: [], sortBy: [.name]),
|
||||
columns: Int = 7)
|
||||
{
|
||||
self.parentID = parentID
|
||||
self.person = person
|
||||
self.genre = genre
|
||||
|
@ -67,7 +66,6 @@ final class LibraryViewModel: ViewModel {
|
|||
$filters
|
||||
.sink(receiveValue: requestItems(with:))
|
||||
.store(in: &cancellables)
|
||||
|
||||
}
|
||||
|
||||
func requestItems(with filters: LibraryFilters) {
|
||||
|
@ -80,8 +78,9 @@ final class LibraryViewModel: ViewModel {
|
|||
genreIDs = filters.withGenres.compactMap(\.id)
|
||||
}
|
||||
let sortBy = filters.sortBy.map(\.rawValue)
|
||||
let shouldBeRecursive: Bool = filters.filters.contains(.isFavorite) || personIDs != [] || studioIDs != [] || genreIDs != []
|
||||
ItemsAPI.getItemsByUserId(userId: SessionManager.main.currentLogin.user.id, startIndex: currentPage * 100, limit: 100, recursive: shouldBeRecursive,
|
||||
|
||||
ItemsAPI.getItemsByUserId(userId: SessionManager.main.currentLogin.user.id, startIndex: currentPage * 100, limit: 100,
|
||||
recursive: true,
|
||||
searchTerm: nil, sortOrder: filters.sortOrder, parentId: parentID,
|
||||
fields: [.primaryImageAspectRatio, .seriesPrimaryImage, .seasonUserData, .overview, .genres, .people, .chapters], includeItemTypes: filters.filters.contains(.isFavorite) ? ["Movie", "Series", "Season", "Episode"] : ["Movie", "Series"],
|
||||
filters: filters.filters, sortBy: sortBy, tags: filters.tags,
|
||||
|
@ -112,8 +111,9 @@ final class LibraryViewModel: ViewModel {
|
|||
genreIDs = filters.withGenres.compactMap(\.id)
|
||||
}
|
||||
let sortBy = filters.sortBy.map(\.rawValue)
|
||||
let shouldBeRecursive: Bool = filters.filters.contains(.isFavorite) || personIDs != [] || studioIDs != [] || genreIDs != []
|
||||
ItemsAPI.getItemsByUserId(userId: SessionManager.main.currentLogin.user.id, startIndex: currentPage * 100, limit: 100, recursive: shouldBeRecursive,
|
||||
|
||||
ItemsAPI.getItemsByUserId(userId: SessionManager.main.currentLogin.user.id, startIndex: currentPage * 100, limit: 100,
|
||||
recursive: true,
|
||||
searchTerm: nil, sortOrder: filters.sortOrder, parentId: parentID,
|
||||
fields: [.primaryImageAspectRatio, .seriesPrimaryImage, .seasonUserData, .overview, .genres, .people, .chapters], includeItemTypes: filters.filters.contains(.isFavorite) ? ["Movie", "Series", "Season", "Episode"] : ["Movie", "Series"],
|
||||
filters: filters.filters, sortBy: sortBy, tags: filters.tags,
|
||||
|
@ -148,10 +148,10 @@ final class LibraryViewModel: ViewModel {
|
|||
}
|
||||
|
||||
private func calculateRows(for itemList: [BaseItemDto]) -> [LibraryRow] {
|
||||
guard itemList.count > 0 else { return [] }
|
||||
guard !itemList.isEmpty else { return [] }
|
||||
let rowCount = itemList.count / columns
|
||||
var calculatedRows = [LibraryRow]()
|
||||
for i in (0...rowCount) {
|
||||
for i in 0 ... rowCount {
|
||||
let firstItemIndex = i * columns
|
||||
var lastItemIndex = firstItemIndex + columns
|
||||
if lastItemIndex > itemList.count {
|
||||
|
@ -159,22 +159,18 @@ final class LibraryViewModel: ViewModel {
|
|||
}
|
||||
|
||||
var rowCells = [LibraryRowCell]()
|
||||
for item in itemList[firstItemIndex..<lastItemIndex] {
|
||||
for item in itemList[firstItemIndex ..< lastItemIndex] {
|
||||
let newCell = LibraryRowCell(item: item)
|
||||
rowCells.append(newCell)
|
||||
}
|
||||
if i == rowCount && hasNextPage {
|
||||
if i == rowCount, hasNextPage {
|
||||
var loadingCell = LibraryRowCell(item: nil)
|
||||
loadingCell.loadingCell = true
|
||||
rowCells.append(loadingCell)
|
||||
}
|
||||
|
||||
calculatedRows.append(
|
||||
LibraryRow(
|
||||
section: i,
|
||||
items: rowCells
|
||||
)
|
||||
)
|
||||
calculatedRows.append(LibraryRow(section: i,
|
||||
items: rowCells))
|
||||
}
|
||||
return calculatedRows
|
||||
}
|
||||
|
|
|
@ -0,0 +1,229 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import JellyfinAPI
|
||||
import SwiftUICollection
|
||||
|
||||
typealias LiveTVChannelRow = CollectionRow<Int, LiveTVChannelRowCell>
|
||||
|
||||
struct LiveTVChannelRowCell: Hashable {
|
||||
let id = UUID()
|
||||
let item: LiveTVChannelProgram
|
||||
}
|
||||
|
||||
struct LiveTVChannelProgram: Hashable {
|
||||
let id = UUID()
|
||||
let channel: BaseItemDto
|
||||
let program: BaseItemDto?
|
||||
}
|
||||
|
||||
final class LiveTVChannelsViewModel: ViewModel {
|
||||
|
||||
@Published var channels = [BaseItemDto]()
|
||||
@Published var channelPrograms = [LiveTVChannelProgram]() {
|
||||
didSet {
|
||||
rows = []
|
||||
let rowChannels = channelPrograms.chunked(into: 4)
|
||||
for (index, rowChans) in rowChannels.enumerated() {
|
||||
rows.append(LiveTVChannelRow(section: index, items: rowChans.map { LiveTVChannelRowCell(item: $0) }))
|
||||
}
|
||||
}
|
||||
}
|
||||
@Published var rows = [LiveTVChannelRow]()
|
||||
|
||||
private var programs = [BaseItemDto]()
|
||||
private var channelProgramsList = [BaseItemDto: [BaseItemDto]]()
|
||||
private var timer: Timer?
|
||||
|
||||
var timeFormatter: DateFormatter {
|
||||
let df = DateFormatter()
|
||||
df.dateFormat = "h:mm"
|
||||
return df
|
||||
}
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
|
||||
getChannels()
|
||||
startScheduleCheckTimer()
|
||||
}
|
||||
|
||||
deinit {
|
||||
stopScheduleCheckTimer()
|
||||
}
|
||||
|
||||
private func getGuideInfo() {
|
||||
LiveTvAPI.getGuideInfo()
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received Guide Info")
|
||||
guard let self = self else { return }
|
||||
self.getChannels()
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
func getChannels() {
|
||||
LiveTvAPI.getLiveTvChannels(
|
||||
userId: SessionManager.main.currentLogin.user.id,
|
||||
startIndex: 0,
|
||||
limit: 1000,
|
||||
enableImageTypes: [.primary],
|
||||
enableUserData: false,
|
||||
enableFavoriteSorting: true
|
||||
)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(response.items?.count ?? 0) Channels")
|
||||
guard let self = self else { return }
|
||||
self.channels = response.items ?? []
|
||||
self.getPrograms()
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func getPrograms() {
|
||||
// http://192.168.1.50:8096/LiveTv/Programs
|
||||
guard channels.count > 0 else {
|
||||
LogManager.shared.log.debug("Cannot get programs, channels list empty. ")
|
||||
return
|
||||
}
|
||||
let channelIds = channels.compactMap { $0.id }
|
||||
|
||||
let minEndDate = Date.now.addComponentsToDate(hours: -1)
|
||||
let maxStartDate = minEndDate.addComponentsToDate(hours: 6)
|
||||
|
||||
let getProgramsDto = GetProgramsDto(
|
||||
channelIds: channelIds,
|
||||
userId: SessionManager.main.currentLogin.user.id,
|
||||
maxStartDate: maxStartDate,
|
||||
minEndDate: minEndDate,
|
||||
sortBy: ["StartDate"],
|
||||
enableImages: true,
|
||||
enableTotalRecordCount: false,
|
||||
imageTypeLimit: 1,
|
||||
enableImageTypes: [.primary],
|
||||
enableUserData: false
|
||||
)
|
||||
|
||||
LiveTvAPI.getPrograms(getProgramsDto: getProgramsDto)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(response.items?.count ?? 0) Programs")
|
||||
guard let self = self else { return }
|
||||
self.programs = response.items ?? []
|
||||
self.channelPrograms = self.processChannelPrograms()
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func processChannelPrograms() -> [LiveTVChannelProgram] {
|
||||
var channelPrograms = [LiveTVChannelProgram]()
|
||||
let now = Date()
|
||||
for channel in self.channels {
|
||||
let prgs = self.programs.filter { item in
|
||||
item.channelId == channel.id
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
self.channelProgramsList[channel] = prgs
|
||||
}
|
||||
|
||||
var currentPrg: BaseItemDto?
|
||||
for prg in prgs {
|
||||
if let startDate = prg.startDate,
|
||||
let endDate = prg.endDate,
|
||||
now.timeIntervalSinceReferenceDate > startDate.timeIntervalSinceReferenceDate &&
|
||||
now.timeIntervalSinceReferenceDate < endDate.timeIntervalSinceReferenceDate {
|
||||
currentPrg = prg
|
||||
}
|
||||
}
|
||||
|
||||
channelPrograms.append(LiveTVChannelProgram(channel: channel, program: currentPrg))
|
||||
}
|
||||
return channelPrograms
|
||||
}
|
||||
|
||||
func startScheduleCheckTimer() {
|
||||
let date = Date()
|
||||
let calendar = Calendar.current
|
||||
var components = calendar.dateComponents([.era, .year, .month, .day, .hour, .minute], from: date)
|
||||
|
||||
// Run on 10th min of every hour
|
||||
guard let minute = components.minute else { return }
|
||||
components.second = 0
|
||||
components.minute = minute + (10 - (minute % 10))
|
||||
|
||||
guard let nextMinute = calendar.date(from: components) else { return }
|
||||
|
||||
if let existingTimer = timer {
|
||||
existingTimer.invalidate()
|
||||
}
|
||||
timer = Timer(fire: nextMinute, interval: 60 * 10, repeats: true) { [weak self] timer in
|
||||
guard let self = self else { return }
|
||||
LogManager.shared.log.debug("LiveTVChannels schedule check...")
|
||||
DispatchQueue.global(qos: .background).async {
|
||||
let newChanPrgs = self.processChannelPrograms()
|
||||
DispatchQueue.main.async {
|
||||
self.channelPrograms = newChanPrgs
|
||||
}
|
||||
}
|
||||
}
|
||||
if let timer = timer {
|
||||
RunLoop.main.add(timer, forMode: .default)
|
||||
}
|
||||
}
|
||||
|
||||
func stopScheduleCheckTimer() {
|
||||
timer?.invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
extension Array {
|
||||
func chunked(into size: Int) -> [[Element]] {
|
||||
return stride(from: 0, to: count, by: size).map {
|
||||
Array(self[$0 ..< Swift.min($0 + size, count)])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Date {
|
||||
func addComponentsToDate(seconds sec: Int? = nil, minutes min: Int? = nil, hours hrs: Int? = nil, days d: Int? = nil) -> Date {
|
||||
var dc = DateComponents()
|
||||
if let sec = sec {
|
||||
dc.second = sec
|
||||
}
|
||||
if let min = min {
|
||||
dc.minute = min
|
||||
}
|
||||
if let hrs = hrs {
|
||||
dc.hour = hrs
|
||||
}
|
||||
if let d = d {
|
||||
dc.day = d
|
||||
}
|
||||
return Calendar.current.date(byAdding: dc, to: self)!
|
||||
}
|
||||
|
||||
func midnightUTCDate() -> Date {
|
||||
var dc: DateComponents = Calendar.current.dateComponents([.year, .month, .day], from: self)
|
||||
dc.hour = 0
|
||||
dc.minute = 0
|
||||
dc.second = 0
|
||||
dc.nanosecond = 0
|
||||
dc.timeZone = TimeZone(secondsFromGMT: 0)
|
||||
return Calendar.current.date(from: dc)!
|
||||
}
|
||||
}
|
|
@ -0,0 +1,204 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import Foundation
|
||||
import JellyfinAPI
|
||||
|
||||
final class LiveTVProgramsViewModel: ViewModel {
|
||||
|
||||
@Published var recommendedItems = [BaseItemDto]()
|
||||
@Published var seriesItems = [BaseItemDto]()
|
||||
@Published var movieItems = [BaseItemDto]()
|
||||
@Published var sportsItems = [BaseItemDto]()
|
||||
@Published var kidsItems = [BaseItemDto]()
|
||||
@Published var newsItems = [BaseItemDto]()
|
||||
|
||||
private var channels = [String:BaseItemDto]()
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
|
||||
getChannels()
|
||||
}
|
||||
|
||||
func findChannel(id: String) -> BaseItemDto? {
|
||||
return channels[id]
|
||||
}
|
||||
|
||||
private func getChannels() {
|
||||
LiveTvAPI.getLiveTvChannels(
|
||||
userId: SessionManager.main.currentLogin.user.id,
|
||||
startIndex: 0,
|
||||
limit: 1000,
|
||||
enableImageTypes: [.primary],
|
||||
enableUserData: false,
|
||||
enableFavoriteSorting: true
|
||||
)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(response.items?.count ?? 0) Channels")
|
||||
guard let self = self else { return }
|
||||
if let chans = response.items {
|
||||
for chan in chans {
|
||||
if let chanId = chan.id {
|
||||
self.channels[chanId] = chan
|
||||
}
|
||||
}
|
||||
self.getRecommendedPrograms()
|
||||
self.getSeries()
|
||||
self.getMovies()
|
||||
self.getSports()
|
||||
self.getKids()
|
||||
self.getNews()
|
||||
}
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func getRecommendedPrograms() {
|
||||
LiveTvAPI.getRecommendedPrograms(
|
||||
userId: SessionManager.main.currentLogin.user.id,
|
||||
limit: 9,
|
||||
isAiring: true,
|
||||
imageTypeLimit: 1,
|
||||
enableImageTypes: [.primary, .thumb],
|
||||
fields: [.channelInfo, .primaryImageAspectRatio],
|
||||
enableTotalRecordCount: false
|
||||
)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(String(response.items?.count ?? 0)) Recommended Programs")
|
||||
guard let self = self else { return }
|
||||
self.recommendedItems = response.items ?? []
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func getSeries() {
|
||||
let getProgramsDto = GetProgramsDto(userId: SessionManager.main.currentLogin.user.id,
|
||||
hasAired: false,
|
||||
isMovie: false,
|
||||
isSeries: true,
|
||||
isNews: false,
|
||||
isKids: false,
|
||||
isSports: false,
|
||||
limit: 9,
|
||||
enableTotalRecordCount: false,
|
||||
enableImageTypes: [.primary, .thumb],
|
||||
fields: [.channelInfo, .primaryImageAspectRatio]
|
||||
)
|
||||
|
||||
LiveTvAPI.getPrograms(getProgramsDto: getProgramsDto)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(String(response.items?.count ?? 0)) Series Items")
|
||||
guard let self = self else { return }
|
||||
self.seriesItems = response.items ?? []
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func getMovies() {
|
||||
let getProgramsDto = GetProgramsDto(userId: SessionManager.main.currentLogin.user.id,
|
||||
hasAired: false,
|
||||
isMovie: true,
|
||||
isSeries: false,
|
||||
isNews: false,
|
||||
isKids: false,
|
||||
isSports: false,
|
||||
limit: 9,
|
||||
enableTotalRecordCount: false,
|
||||
enableImageTypes: [.primary, .thumb],
|
||||
fields: [.channelInfo, .primaryImageAspectRatio]
|
||||
)
|
||||
|
||||
LiveTvAPI.getPrograms(getProgramsDto: getProgramsDto)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(String(response.items?.count ?? 0)) Movie Items")
|
||||
guard let self = self else { return }
|
||||
self.movieItems = response.items ?? []
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func getSports() {
|
||||
let getProgramsDto = GetProgramsDto(userId: SessionManager.main.currentLogin.user.id,
|
||||
hasAired: false,
|
||||
isSports: true,
|
||||
limit: 9,
|
||||
enableTotalRecordCount: false,
|
||||
enableImageTypes: [.primary, .thumb],
|
||||
fields: [.channelInfo, .primaryImageAspectRatio]
|
||||
)
|
||||
|
||||
LiveTvAPI.getPrograms(getProgramsDto: getProgramsDto)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(String(response.items?.count ?? 0)) Sports Items")
|
||||
guard let self = self else { return }
|
||||
self.sportsItems = response.items ?? []
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func getKids() {
|
||||
let getProgramsDto = GetProgramsDto(userId: SessionManager.main.currentLogin.user.id,
|
||||
hasAired: false,
|
||||
isKids: true,
|
||||
limit: 9,
|
||||
enableTotalRecordCount: false,
|
||||
enableImageTypes: [.primary, .thumb],
|
||||
fields: [.channelInfo, .primaryImageAspectRatio]
|
||||
)
|
||||
|
||||
LiveTvAPI.getPrograms(getProgramsDto: getProgramsDto)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(String(response.items?.count ?? 0)) Kids Items")
|
||||
guard let self = self else { return }
|
||||
self.kidsItems = response.items ?? []
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
private func getNews() {
|
||||
let getProgramsDto = GetProgramsDto(userId: SessionManager.main.currentLogin.user.id,
|
||||
hasAired: false,
|
||||
isNews: true,
|
||||
limit: 9,
|
||||
enableTotalRecordCount: false,
|
||||
enableImageTypes: [.primary, .thumb],
|
||||
fields: [.channelInfo, .primaryImageAspectRatio]
|
||||
)
|
||||
|
||||
LiveTvAPI.getPrograms(getProgramsDto: getProgramsDto)
|
||||
.trackActivity(loading)
|
||||
.sink(receiveCompletion: { [weak self] completion in
|
||||
self?.handleAPIRequestError(completion: completion)
|
||||
}, receiveValue: { [weak self] response in
|
||||
LogManager.shared.log.debug("Received \(String(response.items?.count ?? 0)) News Items")
|
||||
guard let self = self else { return }
|
||||
self.newsItems = response.items ?? []
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
//
|
||||
/*
|
||||
* SwiftFin is subject to the terms of the Mozilla Public
|
||||
* License, v2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
|
||||
import SwiftUI
|
||||
import JellyfinAPI
|
||||
|
||||
struct LiveTVChannelItemElement: View {
|
||||
@Environment(\.isFocused) var envFocused: Bool
|
||||
@State var focused: Bool = false
|
||||
|
||||
var channel: BaseItemDto
|
||||
var program: BaseItemDto?
|
||||
var startString = " "
|
||||
var endString = " "
|
||||
var progressPercent = Double(0)
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
HStack {
|
||||
Spacer()
|
||||
Text(channel.number ?? "")
|
||||
.font(.footnote)
|
||||
.frame(alignment: .trailing)
|
||||
}.frame(alignment: .top)
|
||||
ImageView(src: channel.getPrimaryImage(maxWidth: 125))
|
||||
.frame(width: 125, alignment: .center)
|
||||
.offset(x: 0, y: -32)
|
||||
Text(channel.name ?? "?")
|
||||
.font(.footnote)
|
||||
.lineLimit(1)
|
||||
.frame(alignment: .center)
|
||||
Text(program?.name ?? "N/A")
|
||||
.font(.body)
|
||||
.lineLimit(1)
|
||||
.foregroundColor(.green)
|
||||
VStack {
|
||||
HStack {
|
||||
Text(startString)
|
||||
.font(.footnote)
|
||||
.lineLimit(1)
|
||||
.frame(alignment: .leading)
|
||||
|
||||
Spacer()
|
||||
|
||||
Text(endString)
|
||||
.font(.footnote)
|
||||
.lineLimit(1)
|
||||
.frame(alignment: .trailing)
|
||||
}
|
||||
GeometryReader { gp in
|
||||
ZStack(alignment: .leading) {
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.fill(Color.gray)
|
||||
.opacity(0.4)
|
||||
.frame(minWidth: 100, maxWidth: .infinity, minHeight: 12, maxHeight: 12)
|
||||
RoundedRectangle(cornerRadius: 6)
|
||||
.fill(Color(red: 172/255, green: 92/255, blue: 195/255))
|
||||
.frame(width: CGFloat(progressPercent * gp.size.width), height: 12)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(Color.clear)
|
||||
.border(focused ? Color.blue : Color.clear, width: 4)
|
||||
.onChange(of: envFocused) { envFocus in
|
||||
withAnimation(.linear(duration: 0.15)) {
|
||||
self.focused = envFocus
|
||||
}
|
||||
}
|
||||
.scaleEffect(focused ? 1.1 : 1)
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue