mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 20:16:54 +01:00
Fix several build errors.
This commit is contained in:
parent
5b4ffdafba
commit
6725bedc64
@ -95,8 +95,8 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
self.caller = FeedlyAPICaller(transport: session, api: api, secretsProvider: secretsProvider)
|
||||
}
|
||||
|
||||
let databaseFilePath = (dataFolder as NSString).appendingPathComponent("Sync.sqlite3")
|
||||
self.database = SyncDatabase(databaseFilePath: databaseFilePath)
|
||||
let databasePath = (dataFolder as NSString).appendingPathComponent("Sync.sqlite3")
|
||||
self.database = SyncDatabase(databasePath: databasePath)
|
||||
self.oauthAuthorizationClient = api.oauthAuthorizationClient(secretsProvider: secretsProvider)
|
||||
|
||||
self.caller.delegate = self
|
||||
@ -554,13 +554,17 @@ final class FeedlyAccountDelegate: AccountDelegate {
|
||||
|
||||
/// Suspend the SQLLite databases
|
||||
func suspendDatabase() {
|
||||
database.suspend()
|
||||
Task {
|
||||
await database.suspend()
|
||||
}
|
||||
}
|
||||
|
||||
/// Make sure no SQLite databases are open and we are ready to issue network requests.
|
||||
func resume() {
|
||||
database.resume()
|
||||
caller.resume()
|
||||
Task {
|
||||
await database.resume()
|
||||
caller.resume()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,13 +296,17 @@ extension NewsBlurAccountDelegate {
|
||||
apiCall(storyHashGroup) { result in
|
||||
switch result {
|
||||
case .success:
|
||||
self.database.deleteSelectedForProcessing(storyHashGroup.map { String($0) } )
|
||||
group.leave()
|
||||
Task {
|
||||
try? await self.database.deleteSelectedForProcessing(storyHashGroup.map { String($0) } )
|
||||
group.leave()
|
||||
}
|
||||
case .failure(let error):
|
||||
errorOccurred = true
|
||||
os_log(.error, log: self.log, "Story status sync call failed: %@.", error.localizedDescription)
|
||||
self.database.resetSelectedForProcessing(storyHashGroup.map { String($0) } )
|
||||
group.leave()
|
||||
Task {
|
||||
try? await self.database.resetSelectedForProcessing(storyHashGroup.map { String($0) } )
|
||||
group.leave()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ final class NewsBlurAccountDelegate: AccountDelegate {
|
||||
caller = NewsBlurAPICaller(transport: session)
|
||||
}
|
||||
|
||||
database = SyncDatabase(databaseFilePath: dataFolder.appending("/DB.sqlite3"))
|
||||
database = SyncDatabase(databasePath: dataFolder.appending("/DB.sqlite3"))
|
||||
}
|
||||
|
||||
func receiveRemoteNotification(for account: Account, userInfo: [AnyHashable : Any], completion: @escaping () -> Void) {
|
||||
|
@ -3,25 +3,25 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "ArticlesDatabase",
|
||||
name: "ArticlesDatabase",
|
||||
platforms: [.macOS(.v14), .iOS(.v17)],
|
||||
products: [
|
||||
.library(
|
||||
name: "ArticlesDatabase",
|
||||
products: [
|
||||
.library(
|
||||
name: "ArticlesDatabase",
|
||||
type: .dynamic,
|
||||
targets: ["ArticlesDatabase"]),
|
||||
],
|
||||
dependencies: [
|
||||
targets: ["ArticlesDatabase"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/Ranchero-Software/RSCore.git", .upToNextMinor(from: "1.0.0")),
|
||||
.package(url: "https://github.com/Ranchero-Software/RSParser.git", .upToNextMajor(from: "2.0.2")),
|
||||
.package(path: "../Articles"),
|
||||
.package(path: "../Database"),
|
||||
.package(path: "../FMDB"),
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "ArticlesDatabase",
|
||||
dependencies: [
|
||||
targets: [
|
||||
.target(
|
||||
name: "ArticlesDatabase",
|
||||
dependencies: [
|
||||
"RSCore",
|
||||
"Database",
|
||||
"RSParser",
|
||||
|
@ -16,19 +16,19 @@ import Articles
|
||||
// It will go away as we adopt structured concurrency.
|
||||
|
||||
public typealias UnreadCountDictionaryCompletionResult = Result<UnreadCountDictionary,DatabaseError>
|
||||
public typealias UnreadCountDictionaryCompletionBlock = (UnreadCountDictionaryCompletionResult) -> Void
|
||||
public typealias UnreadCountDictionaryCompletionBlock = @Sendable (UnreadCountDictionaryCompletionResult) -> Void
|
||||
|
||||
public typealias SingleUnreadCountResult = Result<Int, DatabaseError>
|
||||
public typealias SingleUnreadCountCompletionBlock = (SingleUnreadCountResult) -> Void
|
||||
public typealias SingleUnreadCountCompletionBlock = @Sendable (SingleUnreadCountResult) -> Void
|
||||
|
||||
public typealias UpdateArticlesResult = Result<ArticleChanges, DatabaseError>
|
||||
public typealias UpdateArticlesCompletionBlock = (UpdateArticlesResult) -> Void
|
||||
public typealias UpdateArticlesCompletionBlock = @Sendable (UpdateArticlesResult) -> Void
|
||||
|
||||
public typealias ArticleSetResult = Result<Set<Article>, DatabaseError>
|
||||
public typealias ArticleSetResultBlock = (ArticleSetResult) -> Void
|
||||
|
||||
public typealias ArticleIDsResult = Result<Set<String>, DatabaseError>
|
||||
public typealias ArticleIDsCompletionBlock = (ArticleIDsResult) -> Void
|
||||
public typealias ArticleIDsCompletionBlock = @Sendable (ArticleIDsResult) -> Void
|
||||
|
||||
public typealias ArticleStatusesResult = Result<Set<ArticleStatus>, DatabaseError>
|
||||
public typealias ArticleStatusesResultBlock = (ArticleStatusesResult) -> Void
|
||||
|
@ -102,7 +102,7 @@ public actor SyncDatabase {
|
||||
#endif
|
||||
}
|
||||
|
||||
func resume() {
|
||||
public func resume() {
|
||||
#if os(iOS)
|
||||
if database == nil {
|
||||
self.database = FMDatabase.openAndSetUpDatabase(path: databasePath)
|
||||
|
Loading…
x
Reference in New Issue
Block a user