1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 06:40:32 +05:30
yattee/Model/Import Export Settings/Importers/RecentlyOpenedImporter.swift

18 lines
502 B
Swift
Raw Normal View History

2024-02-02 04:24:16 +05:30
import Defaults
import SwiftyJSON
struct RecentlyOpenedImporter {
var json: JSON
func performImport() {
if let recentlyOpened = json["recentlyOpened"].array {
2024-05-16 21:58:32 +05:30
for recentlyOpenedJSON in recentlyOpened {
2024-02-02 04:24:16 +05:30
let dict = recentlyOpenedJSON.dictionaryValue.mapValues { json in json.stringValue }
if let item = RecentItemBridge().deserialize(dict) {
RecentsModel.shared.add(item)
}
}
}
}
}