diff --git a/macOS/InstancesSettings.swift b/macOS/InstancesSettings.swift index 748d1fe0..54f5ffa3 100644 --- a/macOS/InstancesSettings.swift +++ b/macOS/InstancesSettings.swift @@ -12,6 +12,7 @@ struct InstancesSettings: View { @State private var frontendURL = "" @State private var proxiesVideos = false @State private var invidiousCompanion = false + @State private var hideVideosWithoutDuration = false @Environment(\.colorScheme) private var colorScheme @ObservedObject private var accounts = AccountsModel.shared @@ -109,6 +110,18 @@ struct InstancesSettings: View { .onChange(of: invidiousCompanion) { newValue in InstancesModel.shared.setInvidiousCompanion(selectedInstance, newValue) } + + hideVideosWithoutDurationToggle + .onAppear { + hideVideosWithoutDuration = selectedInstance.hideVideosWithoutDuration + } + .onChange(of: hideVideosWithoutDuration) { newValue in + InstancesModel.shared.setHideVideosWithoutDuration(selectedInstance, newValue) + } + + Text("This can be used to hide shorts") + .font(.caption) + .foregroundColor(.secondary) } if selectedInstance != nil, !selectedInstance.app.supportsAccounts { @@ -201,6 +214,10 @@ struct InstancesSettings: View { private var invidiousCompanionToggle: some View { Toggle("Invidious companion", isOn: $invidiousCompanion) } + + private var hideVideosWithoutDurationToggle: some View { + Toggle("Experimental: Hide videos without duration", isOn: $hideVideosWithoutDuration) + } } struct InstancesSettingsView_Previews: PreviewProvider {