diff --git a/Kiwix-iOS/Info.plist b/Kiwix-iOS/Info.plist
index 5b2bf79a..8170ac85 100644
--- a/Kiwix-iOS/Info.plist
+++ b/Kiwix-iOS/Info.plist
@@ -49,7 +49,7 @@
CFBundleVersion
- 1.8.342
+ 1.8.361
ITSAppUsesNonExemptEncryption
LSRequiresIPhoneOS
diff --git a/Kiwix-iOSWidgets/Bookmarks/Info.plist b/Kiwix-iOSWidgets/Bookmarks/Info.plist
index 4dd03936..d973ac60 100644
--- a/Kiwix-iOSWidgets/Bookmarks/Info.plist
+++ b/Kiwix-iOSWidgets/Bookmarks/Info.plist
@@ -21,7 +21,7 @@
CFBundleSignature
????
CFBundleVersion
- 1.8.345
+ 1.8.364
NSExtension
NSExtensionMainStoryboard
diff --git a/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Kiwix-iOS.xcscheme b/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Kiwix-iOS.xcscheme
index ce3aad74..902986d0 100644
--- a/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Kiwix-iOS.xcscheme
+++ b/Kiwix.xcodeproj/xcuserdata/Chrisli.xcuserdatad/xcschemes/Kiwix-iOS.xcscheme
@@ -81,6 +81,13 @@
ReferencedContainer = "container:Kiwix.xcodeproj">
+
+
+
+
diff --git a/Kiwix/Operations/ScanLocalBookOperation.swift b/Kiwix/Operations/ScanLocalBookOperation.swift
index 18e3c4e1..2d82b9c3 100644
--- a/Kiwix/Operations/ScanLocalBookOperation.swift
+++ b/Kiwix/Operations/ScanLocalBookOperation.swift
@@ -46,7 +46,10 @@ class ScanLocalBookOperation: Operation {
}
updateReaders()
- updateCoreData()
+ context.performBlockAndWait {self.updateCoreData()}
+
+ context.performBlockAndWait {self.context.saveIfNeeded()}
+ NSManagedObjectContext.mainQueueContext.performBlockAndWait {NSManagedObjectContext.mainQueueContext.saveIfNeeded()}
}
override func operationDidFinish(errors: [ErrorType]) {
@@ -71,6 +74,7 @@ class ScanLocalBookOperation: Operation {
for id in removedZimFileIDs {
guard let book = localBooks[id] else {continue}
if let _ = book.meta4URL {
+ print(book.isLocal)
book.isLocal = false
} else {
context.deleteObject(book)
@@ -94,12 +98,9 @@ class ScanLocalBookOperation: Operation {
book.hasIndex = reader.hasIndex()
}
- if localBooks.count == 0 && addedZimFileIDs.count == 1 {
+ if localBooks.count == 0 && addedZimFileIDs.count >= 1 {
firstBookAdded = true
}
-
- context.performBlockAndWait {self.context.saveIfNeeded()}
- NSManagedObjectContext.mainQueueContext.performBlockAndWait {NSManagedObjectContext.mainQueueContext.saveIfNeeded()}
}
// MARK: - Helper