mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Add option to disable proxying video streams for Invidious
This commit is contained in:
@@ -6,7 +6,7 @@ struct AccountsNavigationLink: View {
|
||||
|
||||
var body: some View {
|
||||
NavigationLink(instance.longDescription) {
|
||||
InstanceSettings(instanceID: instance.id)
|
||||
InstanceSettings(instance: instance)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.contextMenu {
|
||||
|
@@ -1,22 +1,19 @@
|
||||
import SwiftUI
|
||||
|
||||
struct InstanceSettings: View {
|
||||
let instanceID: Instance.ID?
|
||||
let instance: Instance
|
||||
|
||||
@State private var accountsChanged = false
|
||||
@State private var presentingAccountForm = false
|
||||
|
||||
@State private var frontendURL = ""
|
||||
|
||||
var instance: Instance! {
|
||||
InstancesModel.find(instanceID)
|
||||
}
|
||||
@State private var proxiesVideos = false
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
Section(header: Text("Accounts")) {
|
||||
if instance.app.supportsAccounts {
|
||||
ForEach(InstancesModel.accounts(instanceID), id: \.self) { account in
|
||||
ForEach(InstancesModel.accounts(instance.id), id: \.self) { account in
|
||||
#if os(tvOS)
|
||||
Button(account.description) {}
|
||||
.contextMenu {
|
||||
@@ -80,6 +77,16 @@ struct InstanceSettings: View {
|
||||
.keyboardType(.URL)
|
||||
}
|
||||
}
|
||||
|
||||
if instance.app.allowsDisablingVidoesProxying {
|
||||
proxiesVideosToggle
|
||||
.onAppear {
|
||||
proxiesVideos = instance.proxiesVideos
|
||||
}
|
||||
.onChange(of: proxiesVideos) { newValue in
|
||||
InstancesModel.setProxiesVideos(instance, newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
#if os(tvOS)
|
||||
.frame(maxWidth: 1000)
|
||||
@@ -90,6 +97,10 @@ struct InstanceSettings: View {
|
||||
.navigationTitle(instance.description)
|
||||
}
|
||||
|
||||
private var proxiesVideosToggle: some View {
|
||||
Toggle("Proxy videos", isOn: $proxiesVideos)
|
||||
}
|
||||
|
||||
private func removeAccount(_ account: Account) {
|
||||
AccountsModel.remove(account)
|
||||
accountsChanged.toggle()
|
||||
|
Reference in New Issue
Block a user