chore: update Angular cache and TypeScript build info

This commit is contained in:
2025-09-16 12:02:05 -04:00
parent b835bfcdbd
commit 3d78d0aef9
8 changed files with 515 additions and 31 deletions
+3 -3
View File
@@ -193,7 +193,7 @@ export function deleteAllSearchHistory(userId) {
}
// -------------------- Watch History --------------------
export function upsertWatchHistory({ userId, provider, videoId, title, thumbnail, watchedAt, progressSeconds = 0, durationSeconds = 0, lastPositionSeconds = 0 }) {
export function upsertWatchHistory({ userId, provider, videoId, title, thumbnail, watchedAt, progressSeconds = 0, durationSeconds = 0, lastPositionSeconds }) {
const now = nowIso();
const watched_at = watchedAt || now;
// Insert or update on unique (user_id, provider, video_id)
@@ -204,9 +204,9 @@ export function upsertWatchHistory({ userId, provider, videoId, title, thumbnail
thumbnail=COALESCE(excluded.thumbnail, watch_history.thumbnail),
progress_seconds=MAX(excluded.progress_seconds, watch_history.progress_seconds),
duration_seconds=MAX(excluded.duration_seconds, watch_history.duration_seconds),
last_position_seconds=excluded.last_position_seconds,
last_position_seconds=COALESCE(excluded.last_position_seconds, watch_history.last_position_seconds),
last_watched_at=excluded.last_watched_at`).run(
cryptoRandomId(), userId, provider, videoId, title || null, thumbnail || null, watched_at, progressSeconds, durationSeconds, lastPositionSeconds, now
cryptoRandomId(), userId, provider, videoId, title || null, thumbnail || null, watched_at, progressSeconds, durationSeconds, (typeof lastPositionSeconds === 'number' ? lastPositionSeconds : null), now
);
// Return the row id
const row = db.prepare(`SELECT * FROM watch_history WHERE user_id = ? AND provider = ? AND video_id = ?`).get(userId, provider, videoId);