mirror of
https://github.com/yattee/yattee.git
synced 2026-11-03 10:27:19 +00:00
Add an option to share videos via privacy frontend URLs
When enabled (the default), share links to YouTube videos point to the active source's web watch page instead of youtube.com. Invidious serves its frontend at the API URL; Piped uses its configured frontend URL. Videos the active source can't serve (PeerTube, extracted sources) and sources without a web frontend keep their original links. The toggle lives in Settings > Layout & Navigation > Sharing on iOS and macOS, and is shown only when an enabled source has a web watch page.
This commit is contained in:
@@ -22,6 +22,7 @@ struct LayoutNavigationSettingsView: View {
|
||||
#else
|
||||
VideoActionsSection(settings: settings)
|
||||
LinkActionSection(settings: settings)
|
||||
SharingSection(settings: settings)
|
||||
ClipboardSection(settings: settings)
|
||||
#endif
|
||||
#if os(iOS)
|
||||
@@ -143,6 +144,32 @@ private struct LinkActionSection: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Sharing Section
|
||||
|
||||
#if !os(tvOS)
|
||||
private struct SharingSection: View {
|
||||
@Environment(\.appEnvironment) private var appEnvironment
|
||||
@Bindable var settings: SettingsManager
|
||||
|
||||
/// Shown only when a source with a web watch page exists — without one
|
||||
/// the toggle can't change anything.
|
||||
private var hasPrivacyFrontendSource: Bool {
|
||||
appEnvironment?.instancesManager.enabledInstances.contains { $0.watchPageBaseURL != nil } ?? false
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
if hasPrivacyFrontendSource {
|
||||
SettingsFormSection("settings.behavior.sharing.header", footer: "settings.behavior.privacyFrontendSharing.footer") {
|
||||
Toggle(
|
||||
String(localized: "settings.behavior.privacyFrontendSharing"),
|
||||
isOn: $settings.privacyFrontendSharingEnabled
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// MARK: - Clipboard Section
|
||||
|
||||
private struct ClipboardSection: View {
|
||||
|
||||
Reference in New Issue
Block a user