From 8571ee74c49108a83344ea4451bbda1bf7c3bde3 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Thu, 5 Mar 2026 19:56:59 +0100 Subject: [PATCH] fix: use addedAt for unwatched on-deck sort fallback close #636 --- lib/services/data_aggregation_service.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/services/data_aggregation_service.dart b/lib/services/data_aggregation_service.dart index 4257588f..3e9db13d 100644 --- a/lib/services/data_aggregation_service.dart +++ b/lib/services/data_aggregation_service.dart @@ -51,11 +51,10 @@ class DataAggregationService { }).toList(); } - // Sort by most recently viewed - // Use lastViewedAt (when item was last viewed), falling back to updatedAt/addedAt if not available + // Sort by most recently viewed, falling back to addedAt for unwatched items filteredOnDeck.sort((a, b) { - final aTime = a.lastViewedAt ?? a.updatedAt ?? a.addedAt ?? 0; - final bTime = b.lastViewedAt ?? b.updatedAt ?? b.addedAt ?? 0; + final aTime = a.lastViewedAt ?? a.addedAt ?? 0; + final bTime = b.lastViewedAt ?? b.addedAt ?? 0; return bTime.compareTo(aTime); // Descending (most recent first) });