mirror of
https://github.com/yattee/yattee.git
synced 2024-12-15 23:00:32 +05:30
17 lines
477 B
Swift
17 lines
477 B
Swift
|
import Defaults
|
||
|
import SwiftyJSON
|
||
|
|
||
|
struct SponsorBlockSettingsGroupImporter {
|
||
|
var json: JSON
|
||
|
|
||
|
func performImport() {
|
||
|
if let sponsorBlockInstance = json["sponsorBlockInstance"].string {
|
||
|
Defaults[.sponsorBlockInstance] = sponsorBlockInstance
|
||
|
}
|
||
|
|
||
|
if let sponsorBlockCategories = json["sponsorBlockCategories"].array {
|
||
|
Defaults[.sponsorBlockCategories] = Set(sponsorBlockCategories.compactMap { $0.string })
|
||
|
}
|
||
|
}
|
||
|
}
|