mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
63 lines
1.9 KiB
Swift
63 lines
1.9 KiB
Swift
import Foundation
|
|
|
|
extension UserDefaults {
|
|
static var container: UserDefaults = .standard
|
|
|
|
private static let musixmatchTokenKey = "musixmatchToken"
|
|
private static let darkPopUpsKey = "darkPopUps"
|
|
private static let patchTypeKey = "patchType"
|
|
private static let overwriteConfigurationKey = "overwriteConfiguration"
|
|
private static let lyricsColorsKey = "lyricsColors"
|
|
private static let lyricsOptionsKey = "lyricsOptions"
|
|
private static let hasShownCommonIssuesTipKey = "hasShownCommonIssuesTip"
|
|
|
|
static var musixmatchToken: String {
|
|
get {
|
|
container.string(forKey: musixmatchTokenKey) ?? ""
|
|
}
|
|
set (token) {
|
|
container.set(token, forKey: musixmatchTokenKey)
|
|
}
|
|
}
|
|
|
|
static var darkPopUps: Bool {
|
|
get {
|
|
container.object(forKey: darkPopUpsKey) as? Bool ?? true
|
|
}
|
|
set (darkPopUps) {
|
|
container.set(darkPopUps, forKey: darkPopUpsKey)
|
|
}
|
|
}
|
|
|
|
static var patchType: EeveePatchType {
|
|
get {
|
|
if let rawValue = container.object(forKey: patchTypeKey) as? Int {
|
|
return EeveePatchType(rawValue: rawValue) ?? .requests
|
|
}
|
|
|
|
return .notSet
|
|
}
|
|
set (patchType) {
|
|
container.set(patchType.rawValue, forKey: patchTypeKey)
|
|
}
|
|
}
|
|
|
|
static var overwriteConfiguration: Bool {
|
|
get {
|
|
container.bool(forKey: overwriteConfigurationKey)
|
|
}
|
|
set (overwriteConfiguration) {
|
|
container.set(overwriteConfiguration, forKey: overwriteConfigurationKey)
|
|
}
|
|
}
|
|
|
|
static var hasShownCommonIssuesTip: Bool {
|
|
get {
|
|
container.bool(forKey: hasShownCommonIssuesTipKey)
|
|
}
|
|
set (hasShownCommonIssuesTip) {
|
|
container.set(hasShownCommonIssuesTip, forKey: hasShownCommonIssuesTipKey)
|
|
}
|
|
}
|
|
}
|