From 6e8bf306b30e4b1ee6727d0e30e8736f1e0c3621 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 4 Mar 2026 23:14:58 +1300 Subject: [PATCH] Fix getWatchHistory time check --- materialious/src/lib/api/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/materialious/src/lib/api/index.ts b/materialious/src/lib/api/index.ts index 4f173344..082efe87 100644 --- a/materialious/src/lib/api/index.ts +++ b/materialious/src/lib/api/index.ts @@ -292,7 +292,7 @@ export async function getWatchHistory( } let watchHistory = await localDb.watchHistory.toArray(); - watchHistory.sort((a, b) => b.watched.getDate() - a.watched.getDate()); + watchHistory.sort((a, b) => b.watched.getTime() - a.watched.getTime()); if (options.videoIds) { watchHistory = watchHistory.filter((item) => !options.videoIds?.includes(item.videoId)); @@ -345,7 +345,7 @@ export async function updateWatchHistory( if (get(invidiousAuthStore)) postHistoryInvidious(videoId, fetchOptions); - await localDb.watchHistory.update({ videoId }, { progress }); + await localDb.watchHistory.update({ videoId }, { progress, watched: new Date() }); } export async function saveWatchHistory(video: VideoPlay, progress: number = 0) {