Library Backup is now done through icloud
This commit is contained in:
@@ -25,7 +25,7 @@ class LibraryImport {
|
||||
}
|
||||
func backupFiles() -> [String] {
|
||||
do {
|
||||
let documentDirectory = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor:nil, create:false)
|
||||
guard let documentDirectory = try ICloudManager.backup_folder else { return [] }
|
||||
|
||||
let filesInDocumentsDir = try FileManager.default.contentsOfDirectory(at: documentDirectory, includingPropertiesForKeys: .none, options: [])
|
||||
|
||||
@@ -135,13 +135,13 @@ class LibraryImport {
|
||||
|
||||
func importLIB(from filename: String) {
|
||||
do {
|
||||
let documentDirectory = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor:nil, create:false)
|
||||
|
||||
let file = documentDirectory.appendingPathComponent(filename)
|
||||
guard let file = ICloudManager.backup_folder?.appendingPathComponent(filename) else {
|
||||
print("LibraryImport:importLIB Could not get icloud backup folder")
|
||||
return
|
||||
}
|
||||
|
||||
if file.isFileURL {
|
||||
let library = try JSONDecoder().decode(BHLibrary.self, from: Data(contentsOf: file))
|
||||
|
||||
resetDatabase()
|
||||
|
||||
var gameDict = [UUID:Game]()
|
||||
|
||||
Reference in New Issue
Block a user