Add persistent local music catalog
This commit is contained in:
@@ -37,11 +37,12 @@ public actor PlaceholderSyncCoordinator: SyncCoordinator {
|
||||
|
||||
public func performInitialSync() async throws -> SyncResult {
|
||||
let bootstrap = try await apiClient.fetchSyncBootstrap()
|
||||
await store.replaceTracks(bootstrap.tracks)
|
||||
try await store.replaceTracks(bootstrap.tracks)
|
||||
let persistedTracks = try await store.loadTracks()
|
||||
|
||||
return SyncResult(
|
||||
statusMessage: "Sync bootstrap completed. Tracks: \(bootstrap.tracks.count). Next cursor: \(bootstrap.nextCursor.value).",
|
||||
tracks: bootstrap.tracks,
|
||||
statusMessage: "Sync bootstrap completed. Tracks: \(persistedTracks.count). Next cursor: \(bootstrap.nextCursor.value).",
|
||||
tracks: persistedTracks,
|
||||
cursor: bootstrap.nextCursor
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user