mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Add services settings
This commit is contained in:
parent
512613d350
commit
cf0975d8bf
@ -18,6 +18,8 @@ extension Defaults.Keys {
|
||||
static let lastAccountID = Key<Account.ID?>("lastAccountID")
|
||||
static let lastInstanceID = Key<Instance.ID?>("lastInstanceID")
|
||||
|
||||
static let sponsorBlockInstance = Key<String>("sponsorBlockInstance", default: "https://sponsor.ajay.app")
|
||||
|
||||
static let quality = Key<Stream.ResolutionSetting>("quality", default: .hd720pFirstThenBest)
|
||||
|
||||
static let recentlyOpened = Key<[RecentItem]>("recentlyOpened", default: [])
|
||||
|
@ -1,15 +1,25 @@
|
||||
//
|
||||
// ServicesSettings.swift
|
||||
// Pearvidious
|
||||
//
|
||||
// Created by Arkadiusz Fal on 23/10/2021.
|
||||
//
|
||||
|
||||
import Defaults
|
||||
import SwiftUI
|
||||
|
||||
struct ServicesSettings: View {
|
||||
@Default(.sponsorBlockInstance) private var sponsorBlock
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
Section(header: Text("SponsorBlock API")) {
|
||||
TextField(
|
||||
"SponsorBlock API Instance",
|
||||
text: $sponsorBlock,
|
||||
prompt: Text("SponsorBlock API URL, leave blank to disable")
|
||||
)
|
||||
.labelsHidden()
|
||||
#if !os(macOS)
|
||||
.autocapitalization(.none)
|
||||
.keyboardType(.URL)
|
||||
#endif
|
||||
|
||||
#if os(macOS)
|
||||
Spacer()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import SwiftUI
|
||||
struct SettingsView: View {
|
||||
#if os(macOS)
|
||||
private enum Tabs: Hashable {
|
||||
case playback, instances
|
||||
case playback, services, instances
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -24,6 +24,14 @@ struct SettingsView: View {
|
||||
}
|
||||
.tag(Tabs.instances)
|
||||
|
||||
Form {
|
||||
ServicesSettings()
|
||||
}
|
||||
.tabItem {
|
||||
Label("Services", systemImage: "puzzlepiece.extension")
|
||||
}
|
||||
.tag(Tabs.services)
|
||||
|
||||
Form {
|
||||
PlaybackSettings()
|
||||
}
|
||||
@ -41,6 +49,7 @@ struct SettingsView: View {
|
||||
AccountSelectionView()
|
||||
#endif
|
||||
InstancesSettings()
|
||||
ServicesSettings()
|
||||
PlaybackSettings()
|
||||
}
|
||||
.navigationTitle("Settings")
|
||||
|
Loading…
Reference in New Issue
Block a user