mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 10:44:06 +00:00
Watch Now section, horizontal cells
This commit is contained in:
@@ -87,6 +87,10 @@ final class InvidiousAPI: Service {
|
||||
Channel(json: content.json)
|
||||
}
|
||||
|
||||
configureTransformer("/channels/*/latest", requestMethods: [.get]) { (content: Entity<JSON>) -> [Video] in
|
||||
content.json.arrayValue.map(Video.init)
|
||||
}
|
||||
|
||||
configureTransformer("/videos/*", requestMethods: [.get]) { (content: Entity<JSON>) -> Video in
|
||||
Video(content.json)
|
||||
}
|
||||
@@ -120,6 +124,10 @@ final class InvidiousAPI: Service {
|
||||
resource("/channels/\(id)")
|
||||
}
|
||||
|
||||
func channelVideos(_ id: String) -> Resource {
|
||||
resource("/channels/\(id)/latest")
|
||||
}
|
||||
|
||||
func video(_ id: String) -> Resource {
|
||||
resource("/videos/\(id)")
|
||||
}
|
||||
|
@@ -3,10 +3,10 @@ import SwiftUI
|
||||
|
||||
final class NavigationState: ObservableObject {
|
||||
enum TabSelection: Hashable {
|
||||
case subscriptions, popular, trending, playlists, channel(String), playlist(String), search
|
||||
case watchNow, subscriptions, popular, trending, playlists, channel(String), playlist(String), search
|
||||
}
|
||||
|
||||
@Published var tabSelection: TabSelection = .subscriptions
|
||||
@Published var tabSelection: TabSelection = .watchNow
|
||||
|
||||
@Published var showingVideoDetails = false
|
||||
@Published var showingVideo = false
|
||||
|
@@ -6,7 +6,7 @@ final class PlaybackState: ObservableObject {
|
||||
@Published var stream: Stream?
|
||||
@Published var time: CMTime?
|
||||
|
||||
var aspectRatio: CGFloat? {
|
||||
var aspectRatio: Double? {
|
||||
let tracks = stream?.videoAsset.tracks(withMediaType: .video)
|
||||
|
||||
guard tracks != nil else {
|
||||
|
Reference in New Issue
Block a user