From 660891f2a5409d1cfed6b14e1ce7f42f971301ca Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 22 Nov 2025 22:54:45 +0100 Subject: [PATCH] Add hide videos without duration setting to macOS instance settings Added the "Experimental: Hide videos without duration" toggle to the macOS instance settings view to match the iOS/tvOS implementation. --- macOS/InstancesSettings.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 {