|
@@ -445,6 +445,18 @@ public class BackupRestoreView: UIViewController, UITableViewDataSource, UITable
|
|
|
}
|
|
|
}
|
|
|
_ = try Database.shared.insertRecord(fmdb: fmdb, table: "MESSAGE", cvalues: cValues, replace: true)
|
|
|
+ if !(cValues["thumb_id"] as? String ?? "").isEmpty {
|
|
|
+ let thumbId = cValues["thumb_id"] as! String
|
|
|
+ let nsDocumentDirectory = FileManager.SearchPathDirectory.documentDirectory
|
|
|
+ let nsUserDomainMask = FileManager.SearchPathDomainMask.userDomainMask
|
|
|
+ let paths = NSSearchPathForDirectoriesInDomains(nsDocumentDirectory, nsUserDomainMask, true)
|
|
|
+ if let dirPath = paths.first {
|
|
|
+ let thumbURL = URL(fileURLWithPath: dirPath).appendingPathComponent(thumbId)
|
|
|
+ if !FileManager.default.fileExists(atPath: thumbURL.path) {
|
|
|
+ Download().start(forKey: thumbId) { (name, progress) in}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
recordSizeRestore += 1
|
|
|
} catch {
|
|
|
rollback.pointee = true
|