Implement incremental sync and offline recovery
This commit is contained in:
@@ -476,13 +476,15 @@ final class iPhoneLibraryViewModel {
|
||||
}
|
||||
)
|
||||
let store = Self.makeRemoteLibraryStore()
|
||||
let syncCursorStore = Self.makeRemoteLibrarySyncCursorStore()
|
||||
let downloadStateStore = Self.makeRemoteTrackDownloadStateStore()
|
||||
let audioFileStore = Self.makeOfflineAudioFileStore()
|
||||
let artworkStore = Self.makeArtworkStore()
|
||||
let favoriteTrackStore = Self.makeFavoriteTrackStore()
|
||||
let repository = DefaultRemoteLibraryRepository(
|
||||
apiClient: apiClient,
|
||||
store: store
|
||||
store: store,
|
||||
syncCursorStore: syncCursorStore
|
||||
)
|
||||
let syncService = RemoteLibrarySyncService(
|
||||
repository: repository,
|
||||
@@ -726,6 +728,14 @@ final class iPhoneLibraryViewModel {
|
||||
return InMemoryRemoteTrackDownloadStateStore()
|
||||
}
|
||||
|
||||
private static func makeRemoteLibrarySyncCursorStore() -> any RemoteLibrarySyncCursorStore {
|
||||
if let store = try? FileRemoteLibrarySyncCursorStore() {
|
||||
return store
|
||||
}
|
||||
|
||||
return InMemoryRemoteLibrarySyncCursorStore()
|
||||
}
|
||||
|
||||
private static func makeOfflineAudioFileStore() -> any OfflineAudioFileStore {
|
||||
if let store = try? FileOfflineAudioFileStore() {
|
||||
return store
|
||||
|
||||
Reference in New Issue
Block a user