swap timestamp priority from local to trakt first

This commit is contained in:
chrisk325 2026-03-02 12:29:05 +05:30 committed by GitHub
parent 15ee553f86
commit fd8a8dfb4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1180,11 +1180,11 @@ const ContinueWatchingSection = React.forwardRef<ContinueWatchingRef>((props, re
// IMPORTANT: // IMPORTANT:
// In Trakt-auth mode, the "most recently watched" ordering should reflect local playback, // In Trakt-auth mode, the "most recently watched" ordering should reflect local playback,
// not Trakt's paused_at (which can be stale or even appear newer than local). // Use Trakt's paused_at as the primary ordering timestamp (it.lastUpdated),
// So: if we have any local match, use its timestamp for ordering. // falling back to local lastUpdated only if Trakt has no timestamp.
const mergedLastUpdated = (mostRecentLocal.lastUpdated ?? 0) > 0 const mergedLastUpdated = (it.lastUpdated ?? 0) > 0
? (mostRecentLocal.lastUpdated ?? 0) ? (it.lastUpdated ?? 0)
: (it.lastUpdated ?? 0); : (mostRecentLocal.lastUpdated ?? 0);
try { try {
logger.log('[CW][Trakt][Overlay] item/local summary', { logger.log('[CW][Trakt][Overlay] item/local summary', {