Add persistent local music catalog

This commit is contained in:
diyaa
2026-05-28 13:32:40 +02:00
parent 1674174a4e
commit 183d5db4a9
15 changed files with 1315 additions and 41 deletions
@@ -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
)
}