Add option to disable proxying video streams for Invidious

This commit is contained in:
Arkadiusz Fal
2022-07-21 23:52:09 +02:00
parent 6ce9ed3063
commit 827c64719c
7 changed files with 42 additions and 12 deletions

View File

@@ -52,6 +52,17 @@ final class InstancesModel: ObservableObject {
}
}
static func setProxiesVideos(_ instance: Instance, _ proxiesVideos: Bool) {
guard let index = Defaults[.instances].firstIndex(where: { $0.id == instance.id }) else {
return
}
var instance = Defaults[.instances][index]
instance.proxiesVideos = proxiesVideos
Defaults[.instances][index] = instance
}
static func remove(_ instance: Instance) {
let accounts = Self.accounts(instance.id)
if let index = Defaults[.instances].firstIndex(where: { $0.id == instance.id }) {