mirror of
https://github.com/FluxaMedia/fluxa.git
synced 2026-08-19 13:35:57 +00:00
Reconcile Simkl watchlist one-directionally (remote wins)
Simkl's sync/all-items endpoint has no "added to list" timestamp (last_watched_at is watch-history, not list-membership, and is null for plantowatch items) so a real timestamp merge like Trakt's isn't possible without risking local removals being silently undone by a fabricated timestamp. Per explicit decision: items on Simkl's plantowatch list are treated as authoritative and always restored locally each sync, overriding any local removal tombstone. Removing something from Simkl's own list doesn't remove it locally -- that would need a persisted prior-snapshot to detect, out of scope here.
This commit is contained in:
parent
871bd2dcb7
commit
2339bfdc3c
1 changed files with 7 additions and 0 deletions
|
|
@ -119,6 +119,13 @@ internal class HomeLibraryCoordinator(
|
|||
.onFailure { Log.w("HomeLibrary", "Trakt watched reconcile failed", it) }
|
||||
}
|
||||
}
|
||||
if (profile != null && !simklToken.isNullOrBlank()) {
|
||||
scope.launch(Dispatchers.IO) {
|
||||
val remotePlanned = simklPlanned?.await().orEmpty()
|
||||
runCatching { remotePlanned.forEach { watchlistManager.applyRemoteWatchlistAdd(it) } }
|
||||
.onFailure { Log.w("HomeLibrary", "Simkl watchlist reconcile failed", it) }
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.w("HomeLibrary", "Failed to load library data", e)
|
||||
setLibraryState(_state.value.copy(
|
||||
|
|
|
|||
Loading…
Reference in a new issue