mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
redesigned settings, musixmatch lyrics romanization and translation
This commit is contained in:
1 parent
742909efb9
commit
9dde89f07d
22 files changed
+813
-546
No files matched your search
@@ -13,6 +13,7 @@ extension UserDefaults {
|
||||
private static let overwriteConfigurationKey = "overwriteConfiguration"
|
||||
private static let lyricsColorsKey = "lyricsColors"
|
||||
private static let lyricsOptionsKey = "lyricsOptions"
|
||||
private static let hasShownCommonIssuesTipKey = "hasShownCommonIssuesTip"
|
||||
|
||||
static var lyricsSource: LyricsSource {
|
||||
get {
|
||||
@@ -47,11 +48,12 @@ extension UserDefaults {
|
||||
|
||||
static var lyricsOptions: LyricsOptions {
|
||||
get {
|
||||
if let data = defaults.object(forKey: lyricsOptionsKey) as? Data {
|
||||
return try! JSONDecoder().decode(LyricsOptions.self, from: data)
|
||||
if let data = defaults.object(forKey: lyricsOptionsKey) as? Data,
|
||||
let lyricsOptions = try? JSONDecoder().decode(LyricsOptions.self, from: data) {
|
||||
return lyricsOptions
|
||||
}
|
||||
|
||||
return LyricsOptions(geniusRomanizations: false, musixmatchRomanizations: false)
|
||||
return LyricsOptions(romanization: false, musixmatchLanguage: "")
|
||||
}
|
||||
set (lyricsOptions) {
|
||||
defaults.set(try! JSONEncoder().encode(lyricsOptions), forKey: lyricsOptionsKey)
|
||||
@@ -98,6 +100,15 @@ extension UserDefaults {
|
||||
}
|
||||
}
|
||||
|
||||
static var hasShownCommonIssuesTip: Bool {
|
||||
get {
|
||||
defaults.bool(forKey: hasShownCommonIssuesTipKey)
|
||||
}
|
||||
set (hasShownCommonIssuesTip) {
|
||||
defaults.set(hasShownCommonIssuesTip, forKey: hasShownCommonIssuesTipKey)
|
||||
}
|
||||
}
|
||||
|
||||
static var lyricsColors: LyricsColorsSettings {
|
||||
get {
|
||||
if let data = defaults.object(forKey: lyricsColorsKey) as? Data {
|
||||
|
||||
Reference in new issue
Block a user