mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Fix for loading subscriptions
This commit is contained in:
parent
bede29dd51
commit
433725c5e8
@ -30,11 +30,12 @@ final class InvidiousAPI: Service {
|
||||
$0.pipeline[.parsing].add(SwiftyJSONTransformer, contentTypes: ["*/json"])
|
||||
}
|
||||
|
||||
configure("/auth/**") {
|
||||
configure(requestMethods: [.get]) {
|
||||
$0.headers["Cookie"] = self.authHeader
|
||||
}
|
||||
|
||||
configure("**", requestMethods: [.post]) {
|
||||
$0.headers["Cookie"] = self.authHeader
|
||||
$0.pipeline[.parsing].removeTransformers()
|
||||
}
|
||||
|
||||
@ -108,6 +109,10 @@ final class InvidiousAPI: Service {
|
||||
.withParam("region", country.rawValue)
|
||||
}
|
||||
|
||||
var home: Resource {
|
||||
resource(baseURL: InvidiousAPI.instance, path: "/feed/subscriptions")
|
||||
}
|
||||
|
||||
var feed: Resource {
|
||||
resource("/auth/feed")
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ struct Profile {
|
||||
|
||||
var skippedSegmentsCategories = [String]() // SponsorBlockSegmentsProvider.categories
|
||||
|
||||
// var sid = "B3_WzklziGu8JKefihLrCsTNavdj73KMiPUBfN5HW2M="
|
||||
var sid = "RpoS7YPPK2-QS81jJF9z4KSQAjmzsOnMpn84c73-GQ8="
|
||||
|
||||
var cellsColumns = 3
|
||||
|
@ -208,7 +208,10 @@ struct VideoView: View {
|
||||
image
|
||||
.resizable()
|
||||
} placeholder: {
|
||||
ProgressView()
|
||||
HStack {
|
||||
ProgressView()
|
||||
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Image(systemName: "exclamationmark.square")
|
||||
|
@ -12,7 +12,13 @@ struct SubscriptionsView: View {
|
||||
var body: some View {
|
||||
VideosView(videos: store.collection)
|
||||
.onAppear {
|
||||
resource.loadIfNeeded()
|
||||
if let home = InvidiousAPI.shared.home.loadIfNeeded() {
|
||||
home.onSuccess { _ in
|
||||
resource.loadIfNeeded()
|
||||
}
|
||||
} else {
|
||||
resource.loadIfNeeded()
|
||||
}
|
||||
}
|
||||
.refreshable {
|
||||
resource.load()
|
||||
|
@ -2,6 +2,10 @@ import Siesta
|
||||
import SwiftUI
|
||||
|
||||
struct WatchNowView: View {
|
||||
init() {
|
||||
InvidiousAPI.shared.home.loadIfNeeded()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user