Rework the preference to avoid stringly typed properties.

This commit is contained in:
Damiano Galassi committed 2020-02-07 15:31:10 +01:00
1 parent 2694bdee45
commit fbc464e643
22 files changed
+321 -228

No files matched your search

+4 -4
View File
@@ -45,13 +45,13 @@ class OutputPrefsViewController: NSViewController, TokenChangeObserver {
movieField.tokenizingCharacterSet = CharacterSet(charactersIn: "/")
tvShowField.tokenizingCharacterSet = CharacterSet(charactersIn: "/")
movieField.objectValue = UserDefaults.standard.tokenArray(forKey: "SBMovieFormatTokens")
tvShowField.objectValue = UserDefaults.standard.tokenArray(forKey: "SBTVShowFormatTokens")
movieField.objectValue = MetadataPrefs.movieFormatTokens
tvShowField.objectValue = MetadataPrefs.tvShowFormatTokens
}
private func save() {
UserDefaults.standard.set(movieField.objectValue as! [Token], forKey: "SBMovieFormatTokens")
UserDefaults.standard.set(tvShowField.objectValue as! [Token], forKey: "SBTVShowFormatTokens")
MetadataPrefs.movieFormatTokens = movieField.objectValue as! [Token]
MetadataPrefs.tvShowFormatTokens = tvShowField.objectValue as! [Token]
}
// MARK: Actions